@ynput/ayon-frontend-shared 0.4.6 → 0.5.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 (62) hide show
  1. package/dist/DetailsPanel.es.js +686 -653
  2. package/dist/ListTable.es.js +11 -10
  3. package/dist/ProjectTreeTable.es.js +2225 -2186
  4. package/dist/Slicer.es.js +152 -120
  5. package/dist/api.es.js +202 -201
  6. package/dist/chunks/Actions.es.js +20 -20
  7. package/dist/chunks/ColumnDropIndicator.es.js +128 -242
  8. package/dist/chunks/DeleteEntitiesContext.es.js +37 -37
  9. package/dist/chunks/DetailsDialog.es.js +3 -3
  10. package/dist/chunks/EntityPath.es.js +23 -23
  11. package/dist/chunks/EntityPickerDialog.es.js +2 -2
  12. package/dist/chunks/EntityTooltip.es.js +12 -12
  13. package/dist/chunks/Feed.es.js +16 -16
  14. package/dist/chunks/FilterErrorActions.es.js +5 -5
  15. package/dist/chunks/GlobalContext.es.js +14 -14
  16. package/dist/chunks/InfoMessage.es.js +146 -0
  17. package/dist/chunks/JsonViewer.es.js +1 -1
  18. package/dist/chunks/Menu.es.js +5 -5
  19. package/dist/chunks/MenuContext.es.js +75 -73
  20. package/dist/chunks/MetaWidget.es.js +1970 -1962
  21. package/dist/chunks/NewEntityContext.es.js +538 -543
  22. package/dist/chunks/PlayableIcon.es.js +54 -54
  23. package/dist/chunks/ProjectContext.es.js +12 -12
  24. package/dist/chunks/ProjectFoldersContext.es.js +84 -76
  25. package/dist/chunks/RepresentationsList.es.js +1 -1
  26. package/dist/chunks/ReviewablesSelector.es.js +390 -387
  27. package/dist/chunks/SimpleTable.es.js +286 -283
  28. package/dist/chunks/Slicer.es.js +1122 -684
  29. package/dist/chunks/VersionUploadContext.es.js +26 -26
  30. package/dist/chunks/VideoPlayer.es.js +1 -1
  31. package/dist/chunks/ViewsContext.es.js +31 -31
  32. package/dist/chunks/Watchers.es.js +2 -2
  33. package/dist/chunks/entityDefinitions.es.js +275 -133
  34. package/dist/chunks/getUris.es.js +236 -231
  35. package/dist/chunks/searchTerms.es.js +10 -1
  36. package/dist/chunks/useAttributeEnums.es.js +69 -61
  37. package/dist/chunks/useColumnDragRestriction.es.js +1 -1
  38. package/dist/chunks/useLocalStorage.es.js +11 -11
  39. package/dist/chunks/viewUpdateHelper.es.js +23 -23
  40. package/dist/components.es.js +168 -168
  41. package/dist/hooks.es.js +47 -46
  42. package/dist/index.es.js +14 -13
  43. package/dist/types/Actions.d.ts +7 -7
  44. package/dist/types/ContextMenu.d.ts +7 -7
  45. package/dist/types/DetailsPanel.d.ts +13 -7
  46. package/dist/types/EntityPickerDialog.d.ts +7 -7
  47. package/dist/types/Feed.d.ts +7 -7
  48. package/dist/types/ListTable.d.ts +7 -7
  49. package/dist/types/NewEntity.d.ts +7 -7
  50. package/dist/types/ProjectTreeTable.d.ts +35 -13
  51. package/dist/types/RepresentationsList.d.ts +10 -7
  52. package/dist/types/SimpleTable.d.ts +8 -7
  53. package/dist/types/Slicer.d.ts +110 -25
  54. package/dist/types/Views.d.ts +7 -7
  55. package/dist/types/api.d.ts +20 -7
  56. package/dist/types/components.d.ts +14 -12
  57. package/dist/types/context.d.ts +7 -7
  58. package/dist/types/hooks.d.ts +7 -7
  59. package/dist/types/index.d.ts +7 -7
  60. package/dist/types/util.d.ts +7 -7
  61. package/package.json +11 -1
  62. package/dist/chunks/useSlicerSplitter.es.js +0 -18
@@ -1,16 +1,16 @@
1
1
  import { jsx as l, jsxs as z } from "react/jsx-runtime";
2
- import { UserImage as K, theme as L, Icon as V, Button as re, getTextColor as Ne } from "@ynput/ayon-react-components";
2
+ import { UserImage as K, theme as S, Icon as V, Button as re, getTextColor as Ne } from "@ynput/ayon-react-components";
3
3
  import N from "clsx";
4
- import { format as P, isValid as G, isToday as Re, isSameYear as Se, isSameDay as b, isSameWeek as _e, isSameMinute as ae, formatDistanceToNow as Le, subYears as Ie, endOfYear as Z, startOfYear as J, subMonths as Oe, endOfMonth as F, startOfMonth as B, addMonths as ze, subWeeks as $e, endOfWeek as j, startOfWeek as Q, addWeeks as Fe, setHours as X, subDays as Be, endOfDay as ee, startOfDay as te, parseISO as h } from "date-fns";
4
+ import { format as P, isValid as G, isToday as Re, isSameYear as _e, isSameDay as b, isSameWeek as Le, isSameMinute as ae, formatDistanceToNow as Se, subYears as Ie, endOfYear as Z, startOfYear as J, subMonths as Oe, endOfMonth as F, startOfMonth as B, addMonths as ze, subWeeks as $e, endOfWeek as j, startOfWeek as Q, addWeeks as Fe, setHours as X, subDays as Be, endOfDay as ee, startOfDay as te, parseISO as h } from "date-fns";
5
5
  import je from "react-markdown";
6
6
  import Qe from "remark-gfm";
7
7
  import Pe from "rehype-raw";
8
8
  import ie from "turndown";
9
9
  import s, { css as O } from "styled-components";
10
- import { useState as C, useEffect as Y, useMemo as M, createContext as Ge, useContext as Ye, useRef as se, forwardRef as Ve } from "react";
10
+ import { useState as D, useEffect as Y, useMemo as C, createContext as Ge, useContext as Ye, useRef as se, forwardRef as Ve } from "react";
11
11
  import { Quill as ce } from "react-quill-ayon";
12
12
  import { aP as We } from "./searchTerms.es.js";
13
- import { bd as Ue, C as He, bg as Ke, aD as Ze, db as Je, aQ as Xe, aK as et, aZ as tt, K as ot, by as nt, bf as rt, bq as at } from "./getUris.es.js";
13
+ import { be as Ue, C as He, bh as Ke, aE as Ze, dc as Je, aR as Xe, aL as et, a_ as tt, K as ot, bz as nt, bg as rt, br as at } from "./getUris.es.js";
14
14
  import "primereact/confirmdialog";
15
15
  import { union as it, isEqual as st, isArray as ct } from "lodash";
16
16
  import { c as le } from "./MenuContext.es.js";
@@ -219,12 +219,12 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
219
219
  min-width: 0;
220
220
  max-width: fit-content;
221
221
 
222
- ${L.bodySmall}
222
+ ${S.bodySmall}
223
223
  `, xt = (e) => {
224
- let t = Le(e, { addSuffix: !0 });
224
+ let t = Se(e, { addSuffix: !0 });
225
225
  return t = t.replace("about", ""), t = t.replace("minutes", "mins"), t = t.replace("minute", "min"), t = t.replace(" ago", ""), ae(e, /* @__PURE__ */ new Date()) && (t = "Just now"), t;
226
226
  }, xo = ({ date: e, isExact: t, exactTooltip: o = !1, ...n }) => {
227
- const [a, r] = C(!0), [i, d] = C(/* @__PURE__ */ new Date());
227
+ const [a, r] = D(!0), [i, d] = D(/* @__PURE__ */ new Date());
228
228
  if (!e) return null;
229
229
  const c = new Date(e);
230
230
  if (!G(c)) return null;
@@ -235,8 +235,8 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
235
235
  );
236
236
  return () => clearInterval(v);
237
237
  }, []);
238
- const u = Re(c), y = Se(c, i), m = b(c, new Date(i.setDate(i.getDate() - 1))), p = _e(c, i), g = ae(c, i), k = m ? "" : y ? p ? "E" : "MMM d" : "MMM d yyyy", x = "h:mm a", T = M(() => xt(c), [c]), D = M(() => u ? P(c, `${k}, ${x}`) : P(c, `EEEE, dd MMM yyyy ${x}`), [c, u]);
239
- let E = a && !t ? T : D;
238
+ const u = Re(c), y = _e(c, i), m = b(c, new Date(i.setDate(i.getDate() - 1))), p = Le(c, i), g = ae(c, i), k = m ? "" : y ? p ? "E" : "MMM d" : "MMM d yyyy", x = "h:mm a", T = C(() => xt(c), [c]), M = C(() => u ? P(c, `${k}, ${x}`) : P(c, `EEEE, dd MMM yyyy ${x}`), [c, u]);
239
+ let E = a && !t ? T : M;
240
240
  m && a && !t && (E = `Yesterday${E}`), g && (E = "Just now");
241
241
  const R = () => {
242
242
  r(!a);
@@ -249,7 +249,7 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
249
249
  onClick: R,
250
250
  onMouseOver: () => !o && r(!1),
251
251
  onMouseOut: () => !o && r(!0),
252
- "data-tooltip": o ? D : null,
252
+ "data-tooltip": o ? M : null,
253
253
  "data-tooltip-delay": 0,
254
254
  children: E
255
255
  }
@@ -262,7 +262,7 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
262
262
  projectName: a,
263
263
  entityType: r
264
264
  }) => {
265
- const d = M(
265
+ const d = C(
266
266
  () => e.map((v) => ({ id: v.id, projectName: v.projectName, entityType: r })),
267
267
  [e]
268
268
  ).map((v) => v.id), c = !e.length || !t || !n || !a, u = {
@@ -281,19 +281,19 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
281
281
  fetchNextPage: k,
282
282
  hasNextPage: x
283
283
  } = Ue(u, { skip: c });
284
- const T = M(() => y?.pages ? y.pages.flatMap((v) => v.activities || []) : [], [y?.pages]), D = M(() => g?.pages ? g.pages.flatMap((v) => v.activities || []) : [], [g?.pages]), E = async () => {
284
+ const T = C(() => y?.pages ? y.pages.flatMap((v) => v.activities || []) : [], [y?.pages]), M = C(() => g?.pages ? g.pages.flatMap((v) => v.activities || []) : [], [g?.pages]), E = async () => {
285
285
  if (!x) {
286
286
  console.log("No more activities to load");
287
287
  return;
288
288
  }
289
289
  return console.log("loading next page..."), await k();
290
- }, R = M(() => {
290
+ }, R = C(() => {
291
291
  if (!m) return !1;
292
292
  const v = it(
293
- D?.flatMap((S) => S.entityId ? S.entityId : [])
293
+ M?.flatMap((_) => _.entityId ? _.entityId : [])
294
294
  );
295
295
  return !st(v, d);
296
- }, [D, d, m]);
296
+ }, [M, d, m]);
297
297
  return c && (m = !0), {
298
298
  activitiesData: T,
299
299
  isLoadingActivities: m,
@@ -302,7 +302,7 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
302
302
  hasNextPage: x,
303
303
  loadNextPage: E
304
304
  };
305
- }, _ = "no-date", q = (e, t, o, n) => [
305
+ }, L = "no-date", q = (e, t, o, n) => [
306
306
  { label: o, id: e.toISOString() },
307
307
  { label: n, id: t.toISOString() }
308
308
  ], f = {
@@ -321,10 +321,10 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
321
321
  },
322
322
  "after-now": () => [
323
323
  { label: "After today", id: X(/* @__PURE__ */ new Date(), 24).toISOString() },
324
- { id: _, label: _ }
324
+ { id: L, label: L }
325
325
  ],
326
326
  "before-now": () => [
327
- { id: _, label: _ },
327
+ { id: L, label: L },
328
328
  { label: "Before today", id: X(/* @__PURE__ */ new Date(), 0).toISOString() }
329
329
  ],
330
330
  "this-week": () => {
@@ -455,10 +455,10 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
455
455
  values: f["last-year"](),
456
456
  icon: "calendar_month"
457
457
  }
458
- ], Eo = de(), Dt = () => [
458
+ ], Eo = de(), Mt = () => [
459
459
  Tt,
460
460
  ...de()
461
- ], qo = Dt(), Ao = (e, t) => {
461
+ ], qo = Mt(), Ao = (e, t) => {
462
462
  if (!e || !t) return null;
463
463
  try {
464
464
  const o = h(e), n = h(t);
@@ -536,13 +536,13 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
536
536
  } catch {
537
537
  return null;
538
538
  }
539
- }, W = "relative:", Mt = (e) => typeof e == "string" && e.startsWith(W), Ct = (e) => {
539
+ }, W = "relative:", Ct = (e) => typeof e == "string" && e.startsWith(W), Dt = (e) => {
540
540
  const t = e.replace(W, "").split(":");
541
541
  if (t.length !== 2) return null;
542
542
  const o = t[0], n = parseInt(t[1], 10);
543
543
  return !(o in f) || isNaN(n) ? null : { patternId: o, index: n };
544
544
  }, Nt = (e) => {
545
- const t = Ct(e);
545
+ const t = Dt(e);
546
546
  return t ? f[t.patternId]()[t.index]?.id ?? e : e;
547
547
  }, To = (e, t) => `${W}${e}:${t}`, ue = (e) => {
548
548
  if (!e.conditions || e.conditions.length === 0)
@@ -550,17 +550,17 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
550
550
  const t = e.conditions.map((o) => {
551
551
  if ("key" in o) {
552
552
  const n = o;
553
- return Mt(n.value) ? { ...n, value: Nt(n.value) } : n;
553
+ return Ct(n.value) ? { ...n, value: Nt(n.value) } : n;
554
554
  } else
555
555
  return ue(o);
556
556
  });
557
557
  return { ...e, conditions: t };
558
- }, Rt = new Set(Object.keys(He).filter((e) => e !== "activity")), St = {
558
+ }, Rt = new Set(Object.keys(He).filter((e) => e !== "activity")), _t = {
559
559
  has_attachments: "activity_data.files",
560
560
  // not `entity_type`: on inbox rows that column is always 'user'
561
561
  origin_type: "activity_data.origin.type"
562
- }, _t = (e) => !!e && "key" in e, Lt = (e) => {
563
- const t = St[e.key] ?? e.key;
562
+ }, Lt = (e) => !!e && "key" in e, St = (e) => {
563
+ const t = _t[e.key] ?? e.key;
564
564
  if (e.key === "has_attachments")
565
565
  return e.value ? { key: t, operator: "ne", value: [] } : null;
566
566
  if (e.key === "in_review_session")
@@ -587,8 +587,8 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
587
587
  ]
588
588
  } : { ...e, key: t };
589
589
  }, pe = (e) => {
590
- if (_t(e))
591
- return Rt.has(e.key) ? null : Lt(e);
590
+ if (Lt(e))
591
+ return Rt.has(e.key) ? null : St(e);
592
592
  const t = (e.conditions || []).map((o) => pe(o)).filter((o) => o !== null);
593
593
  return t.length === 0 ? null : { operator: e.operator || "and", conditions: t };
594
594
  }, It = (e) => {
@@ -599,17 +599,17 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
599
599
  const t = It(e);
600
600
  if (t)
601
601
  return JSON.stringify(t);
602
- }, Do = "__new__", me = Ge(void 0), Mo = ({ children: e, ...t }) => {
602
+ }, Mo = "__new__", me = Ge(void 0), Co = ({ children: e, ...t }) => {
603
603
  const { isGuest: o } = le(), { data: n = [] } = Ke({ projects: [t.projectName] }), { data: a = [] } = We.useGetTeamsQuery(
604
604
  { projectName: t.projectName, showMembers: !0 },
605
605
  { skip: !t.projectName }
606
- ), r = M(
607
- () => a.filter((w) => w.members?.some((Ce) => Ce.name === t.userName)).map((w) => w.name),
606
+ ), r = C(
607
+ () => a.filter((w) => w.members?.some((De) => De.name === t.userName)).map((w) => w.name),
608
608
  [a, t.userName]
609
- ), [i, d] = C({
609
+ ), [i, d] = D({
610
610
  operator: "and",
611
611
  conditions: []
612
- }), [c, u] = C(""), y = t.feedFilter ?? i, m = t.setFeedFilter ?? d, [p, g] = C(null), [k, x] = C(null), [T, { isLoading: D }] = Ze(), [E, { isLoading: R }] = Je(), [v, { isLoading: S }] = Xe(), ye = D || R || S, be = async (w) => await T(w).unwrap(), ve = async (w) => await E(w).unwrap(), we = async (w) => await v(w).unwrap(), [ke] = et(), [xe] = tt(), Ee = async (w) => await ke(w).unwrap(), qe = async (w) => await xe(w).unwrap(), U = ot(y), H = M(() => Ot(y), [y]), Ae = Et({
612
+ }), [c, u] = D(""), y = t.feedFilter ?? i, m = t.setFeedFilter ?? d, [p, g] = D(null), [k, x] = D(null), [T, { isLoading: M }] = Ze(), [E, { isLoading: R }] = Je(), [v, { isLoading: _ }] = Xe(), ye = M || R || _, be = async (w) => await T(w).unwrap(), ve = async (w) => await E(w).unwrap(), we = async (w) => await v(w).unwrap(), [ke] = et(), [xe] = tt(), Ee = async (w) => await ke(w).unwrap(), qe = async (w) => await xe(w).unwrap(), U = ot(y), H = C(() => Ot(y), [y]), Ae = Et({
613
613
  entities: t.entities,
614
614
  filter: y,
615
615
  backendFilter: H,
@@ -625,9 +625,9 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
625
625
  projectName: t.projectName
626
626
  },
627
627
  { skip: !p }
628
- ), { data: De = [] } = rt({
628
+ ), { data: Me = [] } = rt({
629
629
  projectName: t.projectName
630
- }), { data: Me } = at(
630
+ }), { data: Ce } = at(
631
631
  {
632
632
  projectName: t.projectName,
633
633
  entityIds: t.entities.map((w) => w.id)
@@ -641,8 +641,8 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
641
641
  ...t,
642
642
  ...Ae,
643
643
  mentionSuggestionsData: Te,
644
- categories: De,
645
- checklistCount: Me,
644
+ categories: Me,
645
+ checklistCount: Ce,
646
646
  users: n,
647
647
  isUpdatingActivity: ye,
648
648
  userTeamNames: r,
@@ -704,7 +704,7 @@ class $ extends Ft {
704
704
  }
705
705
  $.sanitize = (e) => e;
706
706
  ce.register($, !0);
707
- const Co = ({ projectName: e, editorRef: t }) => {
707
+ const Do = ({ projectName: e, editorRef: t }) => {
708
708
  const { openSlideOut: o } = le(), [, n] = $t(), a = se(null);
709
709
  a.current = {
710
710
  onClick: (r, i) => {
@@ -951,7 +951,7 @@ const Co = ({ projectName: e, editorRef: t }) => {
951
951
  ]
952
952
  }
953
953
  );
954
- }, So = s.div`
954
+ }, _o = s.div`
955
955
  /* use grid tick for auto height transition */
956
956
  display: grid;
957
957
  height: 100%;
@@ -979,7 +979,7 @@ const Co = ({ projectName: e, editorRef: t }) => {
979
979
  --button-color-secondary: ${t};
980
980
  --button-text-color: ${Ne(e)};
981
981
  --border-color: ${e};
982
- `, _o = s.div`
982
+ `, Lo = s.div`
983
983
  /* VARS */
984
984
  --background-color: var(--md-sys-color-surface-container);
985
985
  --button-color: var(--md-sys-color-primary);
@@ -1320,7 +1320,7 @@ const Co = ({ projectName: e, editorRef: t }) => {
1320
1320
  }
1321
1321
  }
1322
1322
  }
1323
- `, Lo = s.footer`
1323
+ `, So = s.footer`
1324
1324
  display: flex;
1325
1325
  justify-content: space-between;
1326
1326
  padding: var(--padding-m);
@@ -1546,17 +1546,17 @@ const Po = s.li`
1546
1546
  }
1547
1547
 
1548
1548
  h1 {
1549
- ${L.titleLarge}
1549
+ ${S.titleLarge}
1550
1550
  font-size: 24px;
1551
1551
  }
1552
1552
 
1553
1553
  h2 {
1554
- ${L.titleMedium}
1554
+ ${S.titleMedium}
1555
1555
  font-size: 20px;
1556
1556
  }
1557
1557
 
1558
1558
  h3 {
1559
- ${L.titleSmall}
1559
+ ${S.titleSmall}
1560
1560
  font-size: 16px;
1561
1561
  }
1562
1562
 
@@ -1805,7 +1805,7 @@ const Wt = s.pre`
1805
1805
  onClick: () => {
1806
1806
  p !== "user" && p !== "team" && i({ entityId: g, entityType: p, projectName: r, activityId: d });
1807
1807
  },
1808
- onMouseEnter: (D, E) => c({ type: p, id: T, label: k, name: g, pos: E }),
1808
+ onMouseEnter: (M, E) => c({ type: p, id: T, label: k, name: g, pos: E }),
1809
1809
  categoryPrimary: u,
1810
1810
  categorySecondary: y,
1811
1811
  "data-mention-value": `${p}:${g}`,
@@ -1879,7 +1879,7 @@ export {
1879
1879
  At as C,
1880
1880
  jt as D,
1881
1881
  zo as E,
1882
- Do as F,
1882
+ Mo as F,
1883
1883
  Bo as G,
1884
1884
  Yt as H,
1885
1885
  wo as I,
@@ -1887,7 +1887,7 @@ export {
1887
1887
  Go as K,
1888
1888
  Qo as L,
1889
1889
  Oo as M,
1890
- _ as N,
1890
+ L as N,
1891
1891
  Vo as O,
1892
1892
  Jo as P,
1893
1893
  No as Q,
@@ -1901,7 +1901,7 @@ export {
1901
1901
  Zo as Y,
1902
1902
  Ko as Z,
1903
1903
  Ho as _,
1904
- Mo as a,
1904
+ Co as a,
1905
1905
  vt as a0,
1906
1906
  qt as b,
1907
1907
  To as c,
@@ -1910,10 +1910,10 @@ export {
1910
1910
  vo as f,
1911
1911
  de as g,
1912
1912
  qo as h,
1913
- Mt as i,
1913
+ Ct as i,
1914
1914
  Eo as j,
1915
1915
  f as k,
1916
- Dt as l,
1916
+ Mt as l,
1917
1917
  ue as m,
1918
1918
  ko as n,
1919
1919
  Ut as o,
@@ -1921,11 +1921,11 @@ export {
1921
1921
  Ro as q,
1922
1922
  Nt as r,
1923
1923
  $t as s,
1924
- Co as t,
1924
+ Do as t,
1925
1925
  zt as u,
1926
1926
  jo as v,
1927
- So as w,
1928
- _o as x,
1927
+ _o as w,
1928
+ Lo as x,
1929
1929
  $o as y,
1930
- Lo as z
1930
+ So as z
1931
1931
  };
@@ -1,13 +1,13 @@
1
1
  import { jsx as B } from "react/jsx-runtime";
2
2
  import { createContext as E, useCallback as a, useContext as T } from "react";
3
3
  import "./searchTerms.es.js";
4
- import { c0 as G, bZ as Q, dw as F } from "./getUris.es.js";
4
+ import { c1 as G, b_ as Q, dx as _ } from "./getUris.es.js";
5
5
  import "primereact/confirmdialog";
6
6
  import "lodash";
7
7
  import "react-toastify";
8
8
  import { g as l } from "./getEntityTypeIcon.es.js";
9
9
  import "uuid";
10
- const L = {
10
+ const F = {
11
11
  name: "",
12
12
  code: "",
13
13
  productTypes: [],
@@ -25,7 +25,7 @@ const L = {
25
25
  linkTypes: [],
26
26
  ownAttrib: []
27
27
  };
28
- function M(t) {
28
+ function L(t) {
29
29
  if (!t)
30
30
  return { productTypes: [], productBaseTypes: [] };
31
31
  const i = t.productTypes || [], o = /* @__PURE__ */ new Map();
@@ -40,7 +40,7 @@ function M(t) {
40
40
  productBaseTypes: Array.from(o.values())
41
41
  };
42
42
  }
43
- const p = E(void 0), H = ({
43
+ const p = E(void 0), J = ({
44
44
  projectName: t,
45
45
  children: i
46
46
  }) => {
@@ -55,12 +55,12 @@ const p = E(void 0), H = ({
55
55
  } = G({ projectName: t }, { skip: !t }), { data: d = {}, refetch: y } = Q(
56
56
  { projectName: t },
57
57
  { skip: !t }
58
- ), s = d.product_base_types?.default, { data: g } = F(
58
+ ), s = d.product_base_types?.default, { data: g } = _(
59
59
  { projectName: t },
60
60
  {
61
61
  skip: !t
62
62
  }
63
- ), { productTypes: n, productBaseTypes: x } = M(g), h = a(
63
+ ), { productTypes: n, productBaseTypes: x } = L(g), h = a(
64
64
  (c) => o?.folderTypes?.find((e) => e.name === c),
65
65
  [o]
66
66
  ), v = a(
@@ -93,7 +93,7 @@ const p = E(void 0), H = ({
93
93
  p.Provider,
94
94
  {
95
95
  value: {
96
- ...L,
96
+ ...F,
97
97
  ...o,
98
98
  projectName: t,
99
99
  productTypes: n,
@@ -108,14 +108,14 @@ const p = E(void 0), H = ({
108
108
  children: i
109
109
  }
110
110
  );
111
- }, J = () => {
111
+ }, K = () => {
112
112
  const t = T(p);
113
113
  if (t === void 0)
114
114
  throw new Error("useProjectContext must be used within a ProjectContextProvider");
115
115
  return t;
116
- }, K = () => T(p);
116
+ }, R = () => T(p);
117
117
  export {
118
- H as P,
119
- J as a,
120
- K as u
118
+ J as P,
119
+ K as a,
120
+ R as u
121
121
  };
@@ -1,90 +1,98 @@
1
- import { jsx as M } from "react/jsx-runtime";
2
- import { useRef as R, useState as k, useEffect as z, useMemo as u, useContext as E } from "react";
1
+ import { jsx as R } from "react/jsx-runtime";
2
+ import { useRef as k, useState as z, useEffect as B, useMemo as a, useContext as E } from "react";
3
3
  import "./searchTerms.es.js";
4
- import { bH as N } from "./getUris.es.js";
4
+ import { bI as N } from "./getUris.es.js";
5
5
  import "primereact/confirmdialog";
6
- import { P as L } from "./ProjectFoldersContextInstance.es.js";
7
- const Q = (n, p) => {
8
- const d = R(null), [b, l] = k(!1);
9
- return z(() => {
10
- const a = d.current;
11
- !a || Object.keys(n).some((c) => a[c] !== n[c]) || Object.keys(a).some((c) => a[c] !== n[c]) ? (d.current = { ...n }, l(p)) : p || l(!1);
12
- }, [Object.values(n).join(","), p]), b;
13
- }, W = ({
14
- projectName: n,
15
- children: p
6
+ import { P as y } from "./ProjectFoldersContextInstance.es.js";
7
+ const Q = (s, h) => {
8
+ const d = k(null), [b, l] = z(!1);
9
+ return B(() => {
10
+ const u = d.current;
11
+ !u || Object.keys(s).some((c) => u[c] !== s[c]) || Object.keys(u).some((c) => u[c] !== s[c]) ? (d.current = { ...s }, l(h)) : h || l(!1);
12
+ }, [Object.values(s).join(","), h]), b;
13
+ }, H = ({
14
+ projectName: s,
15
+ children: h
16
16
  }) => {
17
17
  const {
18
18
  data: { folders: d = [] } = {},
19
19
  isLoading: b,
20
20
  isFetching: l,
21
- isSuccess: a,
21
+ isSuccess: u,
22
22
  isUninitialized: w,
23
23
  error: c,
24
24
  refetch: S
25
- } = N({ projectName: n, attrib: !0 }), F = Q({ projectName: n }, l || b), f = u(() => {
26
- const t = /* @__PURE__ */ new Map();
27
- for (const r of d)
28
- t.set(r.id, r);
29
- return t;
30
- }, [d]), C = u(() => (t) => f.get(t), [f]), P = u(
31
- () => (t, r, i = {}) => {
32
- if (!r.length) return {};
33
- const e = {}, o = new Set(r), h = /* @__PURE__ */ new Set();
34
- let m = t;
35
- for (; o.size > 0 && m && !h.has(m); ) {
36
- h.add(m);
37
- const s = f.get(m);
38
- if (!s) break;
39
- const A = s.attrib || {};
40
- for (const g of Array.from(o))
41
- s.ownAttrib?.includes(g) && g in A && (e[g] = Object.entries(A).find(
42
- ([O]) => O === g
43
- )?.[1], o.delete(g));
44
- m = s.parentId;
25
+ } = N({ projectName: s, attrib: !0 }), F = Q({ projectName: s }, l || b), f = a(() => {
26
+ const e = /* @__PURE__ */ new Map();
27
+ for (const t of d)
28
+ e.set(t.id, t);
29
+ return e;
30
+ }, [d]), P = a(() => (e) => f.get(e), [f]), C = a(
31
+ () => (e, t, n = {}) => {
32
+ if (!t.length) return {};
33
+ const r = {}, o = new Set(t), p = /* @__PURE__ */ new Set();
34
+ let g = e;
35
+ for (; o.size > 0 && g && !p.has(g); ) {
36
+ p.add(g);
37
+ const i = f.get(g);
38
+ if (!i) break;
39
+ const L = i.attrib || {};
40
+ for (const m of Array.from(o))
41
+ i.ownAttrib?.includes(m) && m in L && (r[m] = Object.entries(L).find(
42
+ ([O]) => O === m
43
+ )?.[1], o.delete(m));
44
+ g = i.parentId;
45
45
  }
46
- for (const s of Array.from(o))
47
- s in i && (e[s] = i[s], o.delete(s));
48
- for (const s of o)
49
- e[s] = null;
50
- return e;
46
+ for (const i of Array.from(o))
47
+ i in n && (r[i] = n[i], o.delete(i));
48
+ for (const i of o)
49
+ r[i] = null;
50
+ return r;
51
51
  },
52
52
  [f]
53
- ), I = u(
54
- () => (t) => {
55
- const r = [], i = /* @__PURE__ */ new Set();
56
- let e = t;
57
- for (; e && !i.has(e); ) {
58
- i.add(e);
59
- const o = f.get(e);
53
+ ), I = a(
54
+ () => (e) => {
55
+ const t = [], n = /* @__PURE__ */ new Set();
56
+ let r = e;
57
+ for (; r && !n.has(r); ) {
58
+ n.add(r);
59
+ const o = f.get(r);
60
60
  if (!o?.parentId) break;
61
- r.push(o.parentId), e = o.parentId;
61
+ t.push(o.parentId), r = o.parentId;
62
62
  }
63
- return r;
63
+ return t;
64
64
  },
65
65
  [f]
66
- ), v = u(
67
- () => (t) => {
68
- const r = new Set(t);
69
- return t.filter((i) => !I(i).some((e) => r.has(e)));
66
+ ), v = a(
67
+ () => (e) => {
68
+ const t = new Set(e);
69
+ return e.filter((n) => !I(n).some((r) => t.has(r)));
70
70
  },
71
71
  [I]
72
- ), j = u(
73
- () => (t, r = !1) => {
74
- const i = r ? [...t] : [], e = [...t];
75
- for (; e.length > 0; ) {
76
- const o = e.shift();
77
- for (const h of d)
78
- h.parentId === o && (i.push(h.id), e.push(h.id));
72
+ ), x = a(() => {
73
+ const e = /* @__PURE__ */ new Map();
74
+ for (const t of d) {
75
+ if (!t.parentId) continue;
76
+ const n = e.get(t.parentId);
77
+ n ? n.push(t.id) : e.set(t.parentId, [t.id]);
78
+ }
79
+ return e;
80
+ }, [d]), j = a(
81
+ () => (e, t = !1) => {
82
+ const n = t ? [...e] : [], r = [...e];
83
+ for (; r.length > 0; ) {
84
+ const o = r.shift();
85
+ for (const p of x.get(o) || [])
86
+ n.push(p), r.push(p);
79
87
  }
80
- return i;
88
+ return n;
81
89
  },
82
- [d]
83
- ), x = () => S().unwrap(), y = u(
90
+ [x]
91
+ ), A = () => S().unwrap(), M = a(
84
92
  () => ({
85
93
  folders: d,
86
- getFolderById: C,
87
- findNonInheritedValues: P,
94
+ getFolderById: P,
95
+ findNonInheritedValues: C,
88
96
  getParentFolderIds: I,
89
97
  getFolderIdsWithoutChildren: v,
90
98
  getChildFolderIds: j,
@@ -92,35 +100,35 @@ const Q = (n, p) => {
92
100
  // first time and when args change
93
101
  isFetching: l,
94
102
  // any background fetching
95
- isSuccess: a,
103
+ isSuccess: u,
96
104
  isUninitialized: w,
97
105
  error: c,
98
- refetch: x
106
+ refetch: A
99
107
  }),
100
108
  [
101
109
  d,
102
- C,
103
110
  P,
111
+ C,
104
112
  I,
105
113
  v,
106
114
  j,
107
115
  F,
108
116
  l,
109
- a,
117
+ u,
110
118
  w,
111
119
  c,
112
- x
120
+ A
113
121
  ]
114
122
  );
115
- return /* @__PURE__ */ M(L.Provider, { value: y, children: p });
116
- }, D = () => {
117
- const n = E(L);
118
- if (n === void 0)
123
+ return /* @__PURE__ */ R(y.Provider, { value: M, children: h });
124
+ }, J = () => {
125
+ const s = E(y);
126
+ if (s === void 0)
119
127
  throw new Error("useProjectFoldersContext must be used within a ProjectFoldersContextProvider");
120
- return n;
128
+ return s;
121
129
  };
122
130
  export {
123
- W as P,
131
+ H as P,
124
132
  Q as a,
125
- D as u
133
+ J as u
126
134
  };
@@ -12,7 +12,7 @@ import "uuid";
12
12
  import "./searchTerms.es.js";
13
13
  import { a as E } from "./useCreateContextMenu.es.js";
14
14
  import { D as F } from "./DetailsDialog.es.js";
15
- import { bZ as H } from "./getUris.es.js";
15
+ import { b_ as H } from "./getUris.es.js";
16
16
  const I = (d = []) => {
17
17
  let n = [];
18
18
  for (const t of d) {