@ynput/ayon-frontend-shared 0.4.7 → 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 (48) hide show
  1. package/dist/DetailsPanel.es.js +684 -651
  2. package/dist/ListTable.es.js +8 -7
  3. package/dist/ProjectTreeTable.es.js +2223 -2184
  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 +127 -241
  8. package/dist/chunks/DeleteEntitiesContext.es.js +36 -36
  9. package/dist/chunks/DetailsDialog.es.js +3 -3
  10. package/dist/chunks/EntityPath.es.js +22 -22
  11. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  12. package/dist/chunks/EntityTooltip.es.js +12 -12
  13. package/dist/chunks/Feed.es.js +2 -2
  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/Menu.es.js +5 -5
  18. package/dist/chunks/MenuContext.es.js +75 -73
  19. package/dist/chunks/MetaWidget.es.js +1968 -1960
  20. package/dist/chunks/NewEntityContext.es.js +538 -543
  21. package/dist/chunks/PlayableIcon.es.js +54 -54
  22. package/dist/chunks/ProjectContext.es.js +12 -12
  23. package/dist/chunks/ProjectFoldersContext.es.js +84 -76
  24. package/dist/chunks/RepresentationsList.es.js +1 -1
  25. package/dist/chunks/ReviewablesSelector.es.js +387 -384
  26. package/dist/chunks/SimpleTable.es.js +286 -283
  27. package/dist/chunks/Slicer.es.js +1121 -683
  28. package/dist/chunks/VersionUploadContext.es.js +26 -26
  29. package/dist/chunks/ViewsContext.es.js +31 -31
  30. package/dist/chunks/Watchers.es.js +1 -1
  31. package/dist/chunks/entityDefinitions.es.js +275 -133
  32. package/dist/chunks/getUris.es.js +236 -231
  33. package/dist/chunks/searchTerms.es.js +9 -0
  34. package/dist/chunks/useAttributeEnums.es.js +69 -61
  35. package/dist/chunks/useLocalStorage.es.js +10 -10
  36. package/dist/chunks/viewUpdateHelper.es.js +23 -23
  37. package/dist/components.es.js +166 -166
  38. package/dist/hooks.es.js +44 -43
  39. package/dist/index.es.js +11 -10
  40. package/dist/types/DetailsPanel.d.ts +6 -0
  41. package/dist/types/ProjectTreeTable.d.ts +28 -6
  42. package/dist/types/RepresentationsList.d.ts +3 -0
  43. package/dist/types/SimpleTable.d.ts +1 -0
  44. package/dist/types/Slicer.d.ts +103 -18
  45. package/dist/types/api.d.ts +13 -0
  46. package/dist/types/components.d.ts +7 -5
  47. package/package.json +11 -10
  48. package/dist/chunks/useSlicerSplitter.es.js +0 -18
@@ -1,72 +1,80 @@
1
- import { useMemo as l, useRef as R, useEffect as S } from "react";
2
- import { b0 as w, bg as B, aw as G, ax as N, aW as C, bh as L, bi as F } from "./searchTerms.es.js";
3
- import { W as O, cg as T, ct as q, ao as I } from "./getUris.es.js";
1
+ import { useMemo as g, useRef as w, useEffect as x } from "react";
2
+ import { b0 as G, bg as M, aw as N, ax as C, aW as I, bh as A, bi as O } from "./searchTerms.es.js";
3
+ import { W as B, ch as P, cu as q, ao as F, as as Q } from "./getUris.es.js";
4
4
  import "primereact/confirmdialog";
5
- import { U as M } from "./MetaWidget.es.js";
6
- const P = [], K = (e) => {
7
- const { entity: m, groupBy: i, skip: k } = e, s = l(
8
- () => i ? O(i, m) : null,
9
- [i, m]
10
- ), E = l(() => s ? [s] : void 0, [s]), u = !!k || !s, g = e.args.projectName, f = T(
11
- { ...e.entity === "task" ? e.args : { projectName: g }, targets: E },
12
- { skip: u || e.entity !== "task" }
13
- ), h = q(
14
- { ...e.entity === "version" ? e.args : { projectName: g }, targets: E },
15
- { skip: u || e.entity !== "version" }
16
- ), r = e.entity === "task" ? f : h, o = r.data ?? P, a = !!r.data, { counts: c, total: v, complete: n } = l(() => {
17
- const t = I(o, s);
18
- return t.ungrouped.count > 0 && t.counts.set(M, t.ungrouped), {
19
- counts: a && t.counts.size > 0 ? t.counts : void 0,
5
+ import { U } from "./MetaWidget.es.js";
6
+ const z = [], K = 3, H = (s) => {
7
+ const { entity: i, groupBy: c, extraGroupBys: E, skip: p } = s, n = g(
8
+ () => c ? B(c, i) : null,
9
+ [c, i]
10
+ ), h = g(() => {
11
+ if (!n) return;
12
+ const t = /* @__PURE__ */ new Set([n.field]), y = [];
13
+ for (const T of E ?? []) {
14
+ const v = B(T, i);
15
+ v && !t.has(v.field) && (t.add(v.field), y.push(v));
16
+ }
17
+ return [n, ...y];
18
+ }, [n, E, i]), u = !!p || !n, m = s.args.projectName, k = P(
19
+ { ...s.entity === "task" ? s.args : { projectName: m }, targets: h },
20
+ { skip: u || s.entity !== "task" }
21
+ ), S = q(
22
+ { ...s.entity === "version" ? s.args : { projectName: m }, targets: h },
23
+ { skip: u || s.entity !== "version" }
24
+ ), e = s.entity === "task" ? k : S, r = e.data ?? z, o = !!e.data, { counts: L, total: a, complete: l } = g(() => {
25
+ const t = F(r, n);
26
+ return t.ungrouped.count > 0 && t.counts.set(U, t.ungrouped), {
27
+ counts: o && t.counts.size > 0 ? t.counts : void 0,
20
28
  total: t.total,
21
29
  complete: t.complete
22
30
  };
23
- }, [o, s, a]), d = R(/* @__PURE__ */ new Set()), y = R(/* @__PURE__ */ new Set()), p = l(() => JSON.stringify(e.args), [e.args]);
24
- return S(() => {
25
- d.current.clear();
26
- }, [p]), S(() => {
27
- if (u || !s || !a || r.isFetching || n) return;
28
- const t = s.field;
29
- if (!y.current.has(t)) {
30
- if (d.current.has(t)) {
31
- y.current.add(t);
32
- return;
33
- }
34
- d.current.add(t), r.refetch();
31
+ }, [r, n, o]), f = w(/* @__PURE__ */ new Map()), d = w(/* @__PURE__ */ new Set()), R = g(() => JSON.stringify(s.args), [s.args]);
32
+ return x(() => {
33
+ f.current.clear(), d.current.clear();
34
+ }, [R]), x(() => {
35
+ if (u || !n || !o || e.isFetching || l) return;
36
+ const t = n.field;
37
+ if (d.current.has(t)) return;
38
+ if (r.some((T) => T.columnName === Q(t))) {
39
+ d.current.add(t);
40
+ return;
35
41
  }
36
- }, [u, s, a, r.isFetching, n, r.refetch]), {
37
- counts: c,
38
- complete: n,
39
- total: v,
40
- isLoading: !u && (r.isLoading || r.isFetching),
41
- isSupported: !!s
42
+ const y = f.current.get(t) ?? 0;
43
+ y >= K || (f.current.set(t, y + 1), e.refetch());
44
+ }, [u, n, o, e.isFetching, l, r, e.refetch]), {
45
+ counts: L,
46
+ complete: l,
47
+ total: a,
48
+ isLoading: !u && (e.isLoading || e.isFetching),
49
+ isSupported: !!n
42
50
  };
43
- }, j = (e, { projectName: m, request: i = "all" } = {}) => {
44
- const k = i === "all" ? "all" : [...i].sort().join("\0"), { data: s, isError: E } = w(), u = !!s || E, { requests: g, keyByName: f } = l(() => {
45
- const o = i === "all" ? null : new Set(i), a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
46
- return e.forEach((n) => {
47
- if (!B(n.data) || o && !o.has(n.name)) return;
48
- const d = s?.find(
49
- ({ name: t }) => t === n.data?.enumResolver
50
- )?.acceptedParams, y = G(n.data, { projectName: m }, d), p = N(y);
51
- c.set(n.name, p), a.has(p) || a.set(p, y);
52
- }), { requests: [...a].sort(([n], [d]) => n.localeCompare(d)).map(([, n]) => n), keyByName: c };
53
- }, [e, k, m, s]), { data: h, isError: r } = C(
54
- { requests: g },
55
- { skip: !g.length || !u }
51
+ }, J = (s, { projectName: i, request: c = "all" } = {}) => {
52
+ const E = c === "all" ? "all" : [...c].sort().join("\0"), { data: p, isError: n } = G(), h = !!p || n, { requests: u, keyByName: m } = g(() => {
53
+ const e = c === "all" ? null : new Set(c), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
54
+ return s.forEach((a) => {
55
+ if (!M(a.data) || e && !e.has(a.name)) return;
56
+ const l = p?.find(
57
+ ({ name: R }) => R === a.data?.enumResolver
58
+ )?.acceptedParams, f = N(a.data, { projectName: i }, l), d = C(f);
59
+ o.set(a.name, d), r.has(d) || r.set(d, f);
60
+ }), { requests: [...r].sort(([a], [l]) => a.localeCompare(l)).map(([, a]) => a), keyByName: o };
61
+ }, [s, E, i, p]), { data: k, isError: S } = I(
62
+ { requests: u },
63
+ { skip: !u.length || !h }
56
64
  );
57
- return l(() => f.size ? e.map((o) => {
58
- const a = f.get(o.name);
59
- if (!a) return o;
60
- const c = h?.[a];
61
- return c ? {
62
- ...o,
65
+ return g(() => m.size ? s.map((e) => {
66
+ const r = m.get(e.name);
67
+ if (!r) return e;
68
+ const o = k?.[r];
69
+ return o ? {
70
+ ...e,
63
71
  enumIsLoading: !1,
64
- enumError: c.error ? L(c.error) : void 0,
65
- data: { ...o.data, enum: F(c.items) }
66
- } : r ? { ...o, enumIsLoading: !1, enumError: L() } : { ...o, enumIsLoading: !0 };
67
- }) : e, [e, f, h, r]);
72
+ enumError: o.error ? A(o.error) : void 0,
73
+ data: { ...e.data, enum: O(o.items) }
74
+ } : S ? { ...e, enumIsLoading: !1, enumError: A() } : { ...e, enumIsLoading: !0 };
75
+ }) : s, [s, m, k, S]);
68
76
  };
69
77
  export {
70
- K as a,
71
- j as u
78
+ H as a,
79
+ J as u
72
80
  };
@@ -1,12 +1,12 @@
1
- import { jsx as k } from "react/jsx-runtime";
2
- import { createContext as P, useState as m, useEffect as S, useContext as I, useRef as A, useCallback as C, useMemo as R } from "react";
3
- import { registerRemotes as E, loadRemote as j } from "@module-federation/enhanced/runtime";
1
+ import { jsx as P } from "react/jsx-runtime";
2
+ import { createContext as k, useState as m, useEffect as S, useContext as I, useRef as A, useCallback as C, useMemo as E } from "react";
3
+ import { registerRemotes as O, loadRemote as j } from "@module-federation/enhanced/runtime";
4
4
  import "./searchTerms.es.js";
5
- import { cO as M } from "./getUris.es.js";
5
+ import { cP as M } from "./getUris.es.js";
6
6
  import "primereact/confirmdialog";
7
7
  import { u as F } from "./GlobalContext.es.js";
8
8
  import D from "semver";
9
- const x = P({
9
+ const x = k({
10
10
  isLoading: !0,
11
11
  modules: [],
12
12
  remotesInitialized: !1
@@ -34,7 +34,7 @@ const x = P({
34
34
  modules: v
35
35
  });
36
36
  });
37
- }), E(
37
+ }), O(
38
38
  l.map((s) => ({
39
39
  name: s.remote,
40
40
  alias: s.remote,
@@ -42,7 +42,7 @@ const x = P({
42
42
  type: "module"
43
43
  }))
44
44
  ), i(!0);
45
- }, [o, c, d, n]), /* @__PURE__ */ k(
45
+ }, [o, c, d, n]), /* @__PURE__ */ P(
46
46
  x.Provider,
47
47
  {
48
48
  value: {
@@ -231,7 +231,7 @@ const x = P({
231
231
  description: "Aggregate each column totals, averages, distributions in a summary footer.",
232
232
  bullet: "Per-column summary footer"
233
233
  }
234
- }, z = P(void 0), X = ({
234
+ }, z = k(void 0), X = ({
235
235
  children: e,
236
236
  debug: t
237
237
  }) => {
@@ -264,7 +264,7 @@ const x = P({
264
264
  }
265
265
  })();
266
266
  }, [t, L, f, u]);
267
- const O = R(
267
+ const R = E(
268
268
  () => ({
269
269
  powerLicense: p,
270
270
  isLoading: w,
@@ -276,7 +276,7 @@ const x = P({
276
276
  }),
277
277
  [p, o, r, i, w]
278
278
  );
279
- return /* @__PURE__ */ k(z.Provider, { value: O, children: e });
279
+ return /* @__PURE__ */ P(z.Provider, { value: R, children: e });
280
280
  }, Y = () => {
281
281
  const e = I(z);
282
282
  if (e === void 0)
@@ -1,22 +1,22 @@
1
1
  import "./searchTerms.es.js";
2
- import { aO as A, dq as D, dt as M } from "./getUris.es.js";
2
+ import { aP as A, dr as D, du as M } from "./getUris.es.js";
3
3
  import "primereact/confirmdialog";
4
4
  import { g as H, u as T } from "./ViewsContext.es.js";
5
5
  import { toast as N } from "react-toastify";
6
- import { useCallback as v, useState as q, useRef as R } from "react";
6
+ import { useCallback as v, useState as P, useRef as R } from "react";
7
7
  import { useStore as U } from "react-redux";
8
8
  let m = !1;
9
9
  const b = () => {
10
10
  m || (m = !0, queueMicrotask(() => {
11
11
  m = !1;
12
12
  }));
13
- }, x = async (e, n, o, t = {}, a, g, f, s) => {
13
+ }, q = async (e, n, o, t = {}, a, u, f, s) => {
14
14
  const {
15
15
  viewSettings: c,
16
16
  viewType: r,
17
17
  projectName: V,
18
18
  selectedView: i,
19
- setSelectedView: u,
19
+ setSelectedView: g,
20
20
  workingView: d,
21
21
  onSettingsChanged: w,
22
22
  isErrorWorkingView: l
@@ -34,7 +34,7 @@ const b = () => {
34
34
  }
35
35
  const C = { ...I, ...e }, h = H(C), k = W ?? d?.id;
36
36
  k && (h.id = k);
37
- const E = h.id, F = g(
37
+ const E = h.id, F = u(
38
38
  {
39
39
  payload: k ? { settings: C } : h,
40
40
  viewType: r,
@@ -42,13 +42,13 @@ const b = () => {
42
42
  },
43
43
  k
44
44
  );
45
- s(), (!y || i?.id !== k) && (i && w(!0), u(E)), await F, n(null), t.successMessage && N.success(t.successMessage);
45
+ s(), (!y || i?.id !== k) && (i && w(!0), g(E)), await F, n(null), t.successMessage && N.success(t.successMessage);
46
46
  } catch (S) {
47
- n(null), p && u(p), i && !y && w(!1);
47
+ n(null), p && g(p), i && !y && w(!1);
48
48
  const W = t.errorMessage || `Failed to update view settings: ${S}`;
49
49
  N.error(W);
50
50
  }
51
- }, O = () => {
51
+ }, x = () => {
52
52
  const [e] = A(), [n] = D(), o = T(), t = U(), a = v(
53
53
  async (s, c) => {
54
54
  if (c) {
@@ -65,18 +65,18 @@ const b = () => {
65
65
  return await e(s).unwrap();
66
66
  },
67
67
  [e, n]
68
- ), g = v(() => {
68
+ ), u = v(() => {
69
69
  const { viewType: s, projectName: c, selectedView: r, workingView: V } = o;
70
70
  if (!s) return {};
71
- const i = t.getState(), u = M.endpoints.getWorkingView.select({
71
+ const i = t.getState(), g = M.endpoints.getWorkingView.select({
72
72
  viewType: s,
73
73
  projectName: c
74
- })(i), w = u?.data?.id || V?.id, l = M.endpoints.getDefaultView.select({
74
+ })(i), w = g?.data?.id || V?.id, l = M.endpoints.getDefaultView.select({
75
75
  viewType: s,
76
76
  projectName: c
77
77
  })(i), p = l?.data?.id || r?.id;
78
- return (!!w && p === w || m) && u?.data?.settings ? {
79
- settings: u.data.settings,
78
+ return (!!w && p === w || m) && g?.data?.settings ? {
79
+ settings: g.data.settings,
80
80
  workingViewId: w
81
81
  } : l?.data?.settings ? {
82
82
  settings: l.data.settings,
@@ -85,11 +85,11 @@ const b = () => {
85
85
  }, [t, o]);
86
86
  return {
87
87
  updateViewSettings: v(
88
- async (...s) => await x(...s, o, a, g, b),
89
- [o, a, g]
88
+ async (...s) => await q(...s, o, a, u, b),
89
+ [o, a, u]
90
90
  ),
91
91
  onCreateView: a,
92
- getLatestSettings: g,
92
+ getLatestSettings: u,
93
93
  markCacheDirty: b
94
94
  };
95
95
  }, L = (e, n) => n.split(".").reduce((o, t) => o?.[t], e), j = (e, n, o) => {
@@ -99,12 +99,12 @@ const b = () => {
99
99
  [t]: a.length ? j(e[t] || {}, a.join("."), o) : o
100
100
  } : e;
101
101
  }, X = (e, n) => {
102
- const { viewSettings: o, isLoadingViews: t } = T(), { updateViewSettings: a, getLatestSettings: g } = O(), [f, s] = q(null), c = R(null), r = o, V = f !== null ? f : L(r, e) ?? n, i = v((d) => {
102
+ const { viewSettings: o, isLoadingViews: t } = T(), { updateViewSettings: a, getLatestSettings: u } = x(), [f, s] = P(null), c = R(null), r = o, V = f !== null ? f : L(r, e) ?? n, i = v((d) => {
103
103
  c.current = d, s(d);
104
- }, []), u = v(
104
+ }, []), g = v(
105
105
  (d) => {
106
106
  if (t || !r) return;
107
- const w = g().settings ?? r, l = c.current !== null ? c.current : L(w, e) ?? n, p = typeof d == "function" ? d(
107
+ const w = u().settings ?? r, l = c.current !== null ? c.current : L(w, e) ?? n, p = typeof d == "function" ? d(
108
108
  l
109
109
  ) : d;
110
110
  a(
@@ -116,7 +116,7 @@ const b = () => {
116
116
  },
117
117
  [
118
118
  n,
119
- g,
119
+ u,
120
120
  t,
121
121
  e,
122
122
  r,
@@ -124,10 +124,10 @@ const b = () => {
124
124
  a
125
125
  ]
126
126
  );
127
- return [V, u];
127
+ return [V, g];
128
128
  };
129
129
  export {
130
- O as a,
131
- x as b,
130
+ x as a,
131
+ q as b,
132
132
  X as u
133
133
  };