@ynput/ayon-frontend-shared 0.6.9 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/ContextMenu.es.js +44 -27
  2. package/dist/DetailsPanel.es.js +767 -740
  3. package/dist/ListTable.es.js +430 -430
  4. package/dist/NewEntity.es.js +43 -42
  5. package/dist/ProjectTreeTable.es.js +3496 -3342
  6. package/dist/Slicer.es.js +301 -276
  7. package/dist/Views.es.js +537 -521
  8. package/dist/api.es.js +429 -412
  9. package/dist/chunks/Actions.es.js +19 -18
  10. package/dist/chunks/ColumnDropIndicator.es.js +19 -18
  11. package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
  12. package/dist/chunks/ContextMenuContextInstance.es.js +4 -3
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +53 -41
  14. package/dist/chunks/DetailsDialog.es.js +26 -24
  15. package/dist/chunks/EmptyPlaceholder.es.js +3 -3
  16. package/dist/chunks/EmptyPlaceholderFlex.styled.es.js +40 -0
  17. package/dist/chunks/EntityPath.es.js +72 -71
  18. package/dist/chunks/EntityPickerDialog.es.js +88 -83
  19. package/dist/chunks/EntityTooltip.es.js +11 -10
  20. package/dist/chunks/EntityUpdatesContext.es.js +11 -11
  21. package/dist/chunks/Feed.es.js +864 -859
  22. package/dist/chunks/FilterErrorActions.es.js +4 -3
  23. package/dist/chunks/Menu.es.js +633 -289
  24. package/dist/chunks/MenuContext.es.js +1 -1
  25. package/dist/chunks/MetaWidget.es.js +2751 -2217
  26. package/dist/chunks/PlayableIcon.es.js +79 -78
  27. package/dist/chunks/ProjectContext.es.js +7 -7
  28. package/dist/chunks/RepresentationsList.es.js +1 -1
  29. package/dist/chunks/ReviewablesSelector.es.js +625 -609
  30. package/dist/chunks/SimpleForm.es.js +1 -1
  31. package/dist/chunks/SimpleTable.es.js +386 -363
  32. package/dist/chunks/Slicer.es.js +954 -821
  33. package/dist/chunks/{DeleteEntitiesContextInstance.es.js → TableExportContextInstance.es.js} +190 -186
  34. package/dist/chunks/TableSettingsFallback.es.js +4 -3
  35. package/dist/chunks/ThumbnailSimple.es.js +96 -95
  36. package/dist/chunks/VideoPlayer.es.js +1 -1
  37. package/dist/chunks/Watchers.es.js +850 -797
  38. package/dist/chunks/getBundleMode.es.js +1 -1
  39. package/dist/chunks/getEntityTypeIcon.es.js +5 -4
  40. package/dist/chunks/getUris.es.js +3704 -3504
  41. package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
  42. package/dist/chunks/searchTerms.es.js +649 -563
  43. package/dist/chunks/sortLists.es.js +22 -0
  44. package/dist/chunks/useAttributeEnums.es.js +21 -21
  45. package/dist/chunks/useHierarchySelection.es.js +6 -5
  46. package/dist/chunks/useLoadModule.es.js +24 -23
  47. package/dist/chunks/viewUpdateHelper.es.js +19 -18
  48. package/dist/components.es.js +628 -593
  49. package/dist/context.es.js +525 -499
  50. package/dist/hooks.es.js +54 -53
  51. package/dist/index.es.js +4 -4
  52. package/dist/types/ContextMenu.d.ts +4 -1
  53. package/dist/types/Feed.d.ts +1 -1
  54. package/dist/types/ListTable.d.ts +1 -1
  55. package/dist/types/ProjectTreeTable.d.ts +144 -14
  56. package/dist/types/SimpleTable.d.ts +2 -1
  57. package/dist/types/Slicer.d.ts +32 -5
  58. package/dist/types/Views.d.ts +6 -0
  59. package/dist/types/api.d.ts +2252 -510
  60. package/dist/types/components.d.ts +52 -4
  61. package/dist/types/context.d.ts +96 -2
  62. package/dist/types/hooks.d.ts +36 -1
  63. package/dist/types/util.d.ts +54 -0
  64. package/dist/util.es.js +129 -119
  65. package/package.json +4 -4
  66. package/dist/chunks/MenuItem.es.js +0 -420
@@ -0,0 +1,22 @@
1
+ const l = { by: "createdAt", desc: !0 }, i = [
2
+ { id: "label", label: "Name", desc: !1 },
3
+ { id: "createdAt", label: "Created", desc: !0 },
4
+ { id: "updatedAt", label: "Updated", desc: !0 }
5
+ ], S = (e) => {
6
+ const { by: t, desc: c } = e || {};
7
+ return i.some((d) => d.id === t) ? { by: t, desc: !!c } : l;
8
+ }, s = (e) => new Date(e || 0).getTime() || 0, u = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), A = (e, t) => u.compare(e.label || "", t.label || ""), o = (e, t) => s(e.createdAt) - s(t.createdAt), p = (e, t) => s(e.updatedAt || e.createdAt) - s(t.updatedAt || t.createdAt), m = {
9
+ label: A,
10
+ createdAt: o,
11
+ updatedAt: p
12
+ }, T = (e, { by: t, desc: c } = l) => {
13
+ const d = m[t] || o, n = c ? -1 : 1;
14
+ return [...e].sort((a, r) => a.active && !r.active ? -1 : !a.active && r.active ? 1 : d(a, r) * n || o(r, a));
15
+ };
16
+ export {
17
+ l as D,
18
+ i as L,
19
+ u as l,
20
+ S as r,
21
+ T as s
22
+ };
@@ -1,37 +1,37 @@
1
- import { useMemo as g, useRef as x, useEffect as A } from "react";
2
- import { b2 as M, bg as N, ax as w, ay as C, aY as I, bh as B, bi as O } from "./searchTerms.es.js";
3
- import { X as G, ck as P, cx as q, ap as F, at as Q } from "./getUris.es.js";
1
+ import { useMemo as g, useRef as G, useEffect as x } from "react";
2
+ import { bb as M, bq as N, aF as q, aG as w, b5 as C, br as A, bs as F } from "./searchTerms.es.js";
3
+ import { Z as B, cq as I, cD as O, at as P, ax as Q } from "./getUris.es.js";
4
4
  import "primereact/confirmdialog";
5
5
  import { U } from "./MetaWidget.es.js";
6
- const z = [], K = 3, Y = (t) => {
6
+ const z = [], D = 3, J = (t) => {
7
7
  const { entity: i, groupBy: c, extraGroupBys: E, skip: p } = t, n = g(
8
- () => c ? G(c, i) : null,
8
+ () => c ? B(c, i) : null,
9
9
  [c, i]
10
10
  ), h = g(() => {
11
11
  if (!n) return;
12
12
  const s = /* @__PURE__ */ new Set([n.field]), y = [];
13
13
  for (const T of E ?? []) {
14
- const v = G(T, i);
14
+ const v = B(T, i);
15
15
  v && !s.has(v.field) && (s.add(v.field), y.push(v));
16
16
  }
17
17
  return [n, ...y];
18
- }, [n, E, i]), u = !!p || !n, m = t.args.projectName, k = P(
18
+ }, [n, E, i]), u = !!p || !n, m = t.args.projectName, k = I(
19
19
  { ...t.entity === "task" ? t.args : { projectName: m }, targets: h },
20
20
  { skip: u || t.entity !== "task" }
21
- ), S = q(
21
+ ), S = O(
22
22
  { ...t.entity === "version" ? t.args : { projectName: m }, targets: h },
23
23
  { skip: u || t.entity !== "version" }
24
24
  ), e = t.entity === "task" ? k : S, r = e.data ?? z, o = !!e.data, { counts: L, total: a, complete: l } = g(() => {
25
- const s = F(r, n);
25
+ const s = P(r, n);
26
26
  return s.ungrouped.count > 0 && s.counts.set(U, s.ungrouped), {
27
27
  counts: o && s.counts.size > 0 ? s.counts : void 0,
28
28
  total: s.total,
29
29
  complete: s.complete
30
30
  };
31
- }, [r, n, o]), f = x(/* @__PURE__ */ new Map()), d = x(/* @__PURE__ */ new Set()), R = g(() => JSON.stringify(t.args), [t.args]);
32
- return A(() => {
31
+ }, [r, n, o]), f = G(/* @__PURE__ */ new Map()), d = G(/* @__PURE__ */ new Set()), R = g(() => JSON.stringify(t.args), [t.args]);
32
+ return x(() => {
33
33
  f.current.clear(), d.current.clear();
34
- }, [R]), A(() => {
34
+ }, [R]), x(() => {
35
35
  if (u || !n || !o || e.isFetching || l) return;
36
36
  const s = n.field;
37
37
  if (d.current.has(s)) return;
@@ -40,7 +40,7 @@ const z = [], K = 3, Y = (t) => {
40
40
  return;
41
41
  }
42
42
  const y = f.current.get(s) ?? 0;
43
- y >= K || (f.current.set(s, y + 1), e.refetch());
43
+ y >= D || (f.current.set(s, y + 1), e.refetch());
44
44
  }, [u, n, o, e.isFetching, l, r, e.refetch]), {
45
45
  counts: L,
46
46
  complete: l,
@@ -48,17 +48,17 @@ const z = [], K = 3, Y = (t) => {
48
48
  isLoading: !u && (e.isLoading || e.isFetching),
49
49
  isSupported: !!n
50
50
  };
51
- }, H = (t, { projectName: i, request: c = "all" } = {}) => {
51
+ }, X = (t, { projectName: i, request: c = "all" } = {}) => {
52
52
  const E = c === "all" ? "all" : [...c].sort().join("\0"), { data: p, isError: n } = M(), h = !!p || n, { requests: u, keyByName: m } = g(() => {
53
53
  const e = c === "all" ? null : new Set(c), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
54
54
  return t.forEach((a) => {
55
55
  if (!N(a.data) || e && !e.has(a.name)) return;
56
56
  const l = p?.find(
57
57
  ({ name: R }) => R === a.data?.enumResolver
58
- )?.acceptedParams, f = w(a.data, { projectName: i }, l), d = C(f);
58
+ )?.acceptedParams, f = q(a.data, { projectName: i }, l), d = w(f);
59
59
  o.set(a.name, d), r.has(d) || r.set(d, f);
60
60
  }), { requests: [...r].sort(([a], [l]) => a.localeCompare(l)).map(([, a]) => a), keyByName: o };
61
- }, [t, E, i, p]), { data: k, isError: S } = I(
61
+ }, [t, E, i, p]), { data: k, isError: S } = C(
62
62
  { requests: u },
63
63
  { skip: !u.length || !h }
64
64
  );
@@ -69,12 +69,12 @@ const z = [], K = 3, Y = (t) => {
69
69
  return o ? {
70
70
  ...e,
71
71
  enumIsLoading: !1,
72
- enumError: o.error ? B(o.error) : void 0,
73
- data: { ...e.data, enum: O(o.items) }
74
- } : S ? { ...e, enumIsLoading: !1, enumError: B() } : { ...e, enumIsLoading: !0 };
72
+ enumError: o.error ? A(o.error) : void 0,
73
+ data: { ...e.data, enum: F(o.items) }
74
+ } : S ? { ...e, enumIsLoading: !1, enumError: A() } : { ...e, enumIsLoading: !0 };
75
75
  }) : t, [t, m, k, S]);
76
76
  };
77
77
  export {
78
- Y as a,
79
- H as u
78
+ J as a,
79
+ X as u
80
80
  };
@@ -6,7 +6,7 @@ import "@ynput/ayon-react-components";
6
6
  import "./searchTerms.es.js";
7
7
  import "./getUris.es.js";
8
8
  import "primereact/confirmdialog";
9
- import { a as o } from "./DeleteEntitiesContextInstance.es.js";
9
+ import { a as o } from "./TableExportContextInstance.es.js";
10
10
  import "lodash";
11
11
  import "uuid";
12
12
  import "semver";
@@ -14,11 +14,12 @@ import "./ContextMenuContextInstance.es.js";
14
14
  import "clsx";
15
15
  import "react-dom";
16
16
  import "react-redux";
17
+ import "react-router-dom";
17
18
  import { u as t } from "./MetaWidget.es.js";
18
- const g = () => {
19
- const i = t(), { powerLicense: e } = o();
20
- return i ? (e ? i.slices : i.slices?.slice(0, 1))?.some((r) => r.sliceType === "hierarchy") ? i.getPanelSelection("hierarchy") : i.pinnedSlice?.rowSelection ?? null : null;
19
+ const k = () => {
20
+ const i = t(), { powerLicense: r } = o();
21
+ return i ? (r ? i.slices : i.slices?.slice(0, 1))?.some((e) => e.sliceType === "hierarchy") ? i.getPanelSelection("hierarchy") : i.pinnedSlice?.rowSelection ?? null : null;
21
22
  };
22
23
  export {
23
- g as u
24
+ k as u
24
25
  };
@@ -1,12 +1,12 @@
1
1
  import "react/jsx-runtime";
2
- import { useState as f, useRef as z, useEffect as I } from "react";
2
+ import { useState as d, useRef as z, useEffect as I } from "react";
3
3
  import { loadRemote as M } from "@module-federation/enhanced/runtime";
4
4
  import "react-toastify";
5
5
  import "@ynput/ayon-react-components";
6
6
  import "./searchTerms.es.js";
7
7
  import "./getUris.es.js";
8
8
  import "primereact/confirmdialog";
9
- import { b as q } from "./DeleteEntitiesContextInstance.es.js";
9
+ import { c as q } from "./TableExportContextInstance.es.js";
10
10
  import "lodash";
11
11
  import "uuid";
12
12
  import h from "semver";
@@ -14,62 +14,63 @@ import "./ContextMenuContextInstance.es.js";
14
14
  import "clsx";
15
15
  import "react-dom";
16
16
  import "react-redux";
17
- const H = ({
18
- addon: o,
17
+ import "react-router-dom";
18
+ const J = ({
19
+ addon: r,
19
20
  remote: t,
20
21
  module: e,
21
22
  fallback: L,
22
23
  minVersion: s,
23
- skip: u = !1,
24
+ skip: f = !1,
24
25
  defer: l = !1
25
26
  }) => {
26
- const { remotesInitialized: c, modules: a } = q(), [v, r] = f(!0), [d, m] = f(!1), [R, p] = f(!1), g = z(L);
27
+ const { remotesInitialized: c, modules: a } = q(), [v, o] = d(!0), [u, m] = d(!1), [R, p] = d(!1), g = z(L);
27
28
  return I(() => {
28
- if (u) {
29
- r(!1), m(!0);
29
+ if (f) {
30
+ o(!1), m(!0);
30
31
  return;
31
32
  }
32
- if (l || !c || !o || !t || !e) return;
33
- const i = a.find((n) => n.addonName === o);
33
+ if (l || !c || !r || !t || !e) return;
34
+ const i = a.find((n) => n.addonName === r);
34
35
  if (!i) {
35
- console.log("remote not found", { addon: o, remote: t, module: e }), r(!1);
36
+ console.log("remote not found", { addon: r, remote: t, module: e }), o(!1);
36
37
  return;
37
38
  }
38
39
  if (s && !h.gte(i.addonVersion, s) && s + "-dev" !== i.addonVersion) {
39
40
  console.log("remote version does not meet minimum requirement", {
40
- addon: o,
41
+ addon: r,
41
42
  remote: t,
42
43
  module: e,
43
44
  current: i.addonVersion,
44
45
  required: s
45
- }), p(!0), r(!1);
46
+ }), p(!0), o(!1);
46
47
  return;
47
48
  }
48
49
  if (p(!1), !i.modules[t])
49
- return r(!1), console.log("module not found", { addon: o, remote: t, module: e });
50
- if (d === e) {
51
- r(!1);
50
+ return o(!1), console.log("module not found", { addon: r, remote: t, module: e });
51
+ if (u === e) {
52
+ o(!1);
52
53
  return;
53
54
  }
54
- M(`${t}/${e}`, {
55
+ o(!0), M(`${t}/${e}`, {
55
56
  from: "runtime"
56
57
  }).then((n) => {
57
- m(e), r(!1), n && (g.current = n.default);
58
+ m(e), o(!1), n && (g.current = n.default);
58
59
  }).catch((n) => {
59
- r(!1), console.error("error loading remote", t, e, n);
60
+ o(!1), console.error("error loading remote", t, e, n);
60
61
  });
61
- }, [d, c, a, o, t, e, s, u, l]), [
62
+ }, [u, c, a, r, t, e, s, f, l]), [
62
63
  g.current,
63
64
  {
64
- isLoaded: d === e,
65
+ isLoaded: u === e,
65
66
  isLoading: v,
66
67
  outdated: R ? {
67
- current: a.find((i) => i.addonName === o)?.addonVersion || "unknown",
68
+ current: a.find((i) => i.addonName === r)?.addonVersion || "unknown",
68
69
  required: s?.replace("-dev", "") || "unknown"
69
70
  } : void 0
70
71
  }
71
72
  ];
72
73
  };
73
74
  export {
74
- H as u
75
+ J as u
75
76
  };
@@ -1,18 +1,19 @@
1
1
  import "./searchTerms.es.js";
2
- import { aQ as A, dv as D, dy as b } from "./getUris.es.js";
2
+ import { aU as A, dC as D, dF as b } from "./getUris.es.js";
3
3
  import "primereact/confirmdialog";
4
4
  import { v4 as H } from "uuid";
5
5
  import { toast as M } from "react-toastify";
6
- import { useCallback as k, useState as R, useRef as U } from "react";
6
+ import { useCallback as k, useState as U, useRef as R } from "react";
7
7
  import { useStore as q } from "react-redux";
8
8
  import "react/jsx-runtime";
9
- import { e as T } from "./DeleteEntitiesContextInstance.es.js";
9
+ import { e as L } from "./TableExportContextInstance.es.js";
10
10
  import "@ynput/ayon-react-components";
11
11
  import "@module-federation/enhanced/runtime";
12
12
  import "lodash";
13
13
  import "./ContextMenuContextInstance.es.js";
14
14
  import "clsx";
15
15
  import "react-dom";
16
+ import "react-router-dom";
16
17
  import "semver";
17
18
  const x = () => H().replace(/-/g, ""), P = (e = {}) => ({
18
19
  id: x(),
@@ -25,7 +26,7 @@ const N = () => {
25
26
  v || (v = !0, queueMicrotask(() => {
26
27
  v = !1;
27
28
  }));
28
- }, Q = async (e, n, o, t = {}, r, g, f, i) => {
29
+ }, $ = async (e, n, o, t = {}, r, g, f, i) => {
29
30
  const {
30
31
  viewSettings: a,
31
32
  viewType: c,
@@ -49,7 +50,7 @@ const N = () => {
49
50
  }
50
51
  const C = { ...h, ...e }, I = P(C), m = W ?? d?.id;
51
52
  m && (I.id = m);
52
- const E = I.id, F = g(
53
+ const j = I.id, E = g(
53
54
  {
54
55
  payload: m ? { settings: C } : I,
55
56
  viewType: c,
@@ -57,14 +58,14 @@ const N = () => {
57
58
  },
58
59
  m
59
60
  );
60
- i(), (!y || s?.id !== m) && (s && w(!0), u(E)), await F, n(null), t.successMessage && M.success(t.successMessage);
61
+ i(), (!y || s?.id !== m) && (s && w(!0), u(j)), await E, n(null), t.successMessage && M.success(t.successMessage);
61
62
  } catch (S) {
62
63
  n(null), p && u(p), s && !y && w(!1);
63
64
  const W = t.errorMessage || `Failed to update view settings: ${S}`;
64
65
  M.error(W);
65
66
  }
66
- }, $ = () => {
67
- const [e] = A(), [n] = D(), o = T(), t = q(), r = k(
67
+ }, z = () => {
68
+ const [e] = A(), [n] = D(), o = L(), t = q(), r = k(
68
69
  async (i, a) => {
69
70
  if (a) {
70
71
  const c = {};
@@ -100,30 +101,30 @@ const N = () => {
100
101
  }, [t, o]);
101
102
  return {
102
103
  updateViewSettings: k(
103
- async (...i) => await Q(...i, o, r, g, N),
104
+ async (...i) => await $(...i, o, r, g, N),
104
105
  [o, r, g]
105
106
  ),
106
107
  onCreateView: r,
107
108
  getLatestSettings: g,
108
109
  markCacheDirty: N
109
110
  };
110
- }, L = (e, n) => n.split(".").reduce((o, t) => o?.[t], e), j = (e, n, o) => {
111
+ }, F = (e, n) => n.split(".").reduce((o, t) => o?.[t], e), T = (e, n, o) => {
111
112
  const [t, ...r] = n.split(".");
112
113
  return t ? {
113
114
  ...e,
114
- [t]: r.length ? j(e[t] || {}, r.join("."), o) : o
115
+ [t]: r.length ? T(e[t] || {}, r.join("."), o) : o
115
116
  } : e;
116
- }, ae = (e, n) => {
117
- const { viewSettings: o, isLoadingViews: t } = T(), { updateViewSettings: r, getLatestSettings: g } = $(), [f, i] = R(null), a = U(null), c = o, V = f !== null ? f : L(c, e) ?? n, s = k((d) => {
117
+ }, ce = (e, n) => {
118
+ const { viewSettings: o, isLoadingViews: t } = L(), { updateViewSettings: r, getLatestSettings: g } = z(), [f, i] = U(null), a = R(null), c = o, V = f !== null ? f : F(c, e) ?? n, s = k((d) => {
118
119
  a.current = d, i(d);
119
120
  }, []), u = k(
120
121
  (d) => {
121
122
  if (t) return;
122
- const w = g().settings ?? c ?? {}, l = a.current !== null ? a.current : L(w, e) ?? n, p = typeof d == "function" ? d(
123
+ const w = g().settings ?? c ?? {}, l = a.current !== null ? a.current : F(w, e) ?? n, p = typeof d == "function" ? d(
123
124
  l
124
125
  ) : d;
125
126
  r(
126
- j(w, e, p),
127
+ T(w, e, p),
127
128
  s,
128
129
  p,
129
130
  {}
@@ -142,9 +143,9 @@ const N = () => {
142
143
  return [V, u];
143
144
  };
144
145
  export {
145
- $ as a,
146
- Q as b,
146
+ z as a,
147
+ $ as b,
147
148
  x as c,
148
149
  P as g,
149
- ae as u
150
+ ce as u
150
151
  };