@ynput/ayon-frontend-shared 0.6.8 → 0.7.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 (67) hide show
  1. package/dist/ContextMenu.es.js +44 -27
  2. package/dist/DetailsPanel.es.js +225 -224
  3. package/dist/Feed.es.js +64 -58
  4. package/dist/ListTable.es.js +423 -423
  5. package/dist/NewEntity.es.js +44 -43
  6. package/dist/ProjectTreeTable.es.js +3517 -3378
  7. package/dist/Slicer.es.js +301 -276
  8. package/dist/Views.es.js +366 -352
  9. package/dist/api.es.js +428 -413
  10. package/dist/chunks/Actions.es.js +18 -17
  11. package/dist/chunks/ColumnDropIndicator.es.js +21 -20
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
  13. package/dist/chunks/ContextMenuContextInstance.es.js +4 -3
  14. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +53 -41
  15. package/dist/chunks/DetailsDialog.es.js +26 -24
  16. package/dist/chunks/EmptyPlaceholder.es.js +3 -3
  17. package/dist/chunks/EmptyPlaceholderFlex.styled.es.js +40 -0
  18. package/dist/chunks/EntityPath.es.js +60 -59
  19. package/dist/chunks/EntityPickerDialog.es.js +88 -83
  20. package/dist/chunks/EntityTooltip.es.js +15 -14
  21. package/dist/chunks/EntityUpdatesContext.es.js +11 -11
  22. package/dist/chunks/Feed.es.js +1072 -1088
  23. package/dist/chunks/FilterErrorActions.es.js +4 -3
  24. package/dist/chunks/Menu.es.js +633 -289
  25. package/dist/chunks/MenuContext.es.js +1 -1
  26. package/dist/chunks/MetaWidget.es.js +2449 -2199
  27. package/dist/chunks/PlayableIcon.es.js +128 -88
  28. package/dist/chunks/ProjectContext.es.js +6 -6
  29. package/dist/chunks/RepresentationsList.es.js +1 -1
  30. package/dist/chunks/ReviewablesSelector.es.js +627 -611
  31. package/dist/chunks/SimpleForm.es.js +11 -10
  32. package/dist/chunks/SimpleTable.es.js +386 -363
  33. package/dist/chunks/Slicer.es.js +956 -823
  34. package/dist/chunks/{DeleteEntitiesContextInstance.es.js → TableExportContextInstance.es.js} +190 -186
  35. package/dist/chunks/TableSettingsFallback.es.js +4 -3
  36. package/dist/chunks/ThumbnailSimple.es.js +100 -99
  37. package/dist/chunks/VideoPlayer.es.js +1 -1
  38. package/dist/chunks/Watchers.es.js +224 -223
  39. package/dist/chunks/getBundleMode.es.js +33 -25
  40. package/dist/chunks/getEntityTypeIcon.es.js +5 -4
  41. package/dist/chunks/getUris.es.js +3873 -3736
  42. package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
  43. package/dist/chunks/searchTerms.es.js +621 -499
  44. package/dist/chunks/sortLists.es.js +22 -0
  45. package/dist/chunks/useAttributeEnums.es.js +43 -43
  46. package/dist/chunks/useDateRangeFilter.es.js +85 -59
  47. package/dist/chunks/useHierarchySelection.es.js +6 -5
  48. package/dist/chunks/useLoadModule.es.js +24 -23
  49. package/dist/chunks/viewUpdateHelper.es.js +41 -40
  50. package/dist/components.es.js +963 -891
  51. package/dist/context.es.js +528 -501
  52. package/dist/hooks.es.js +15 -15
  53. package/dist/index.es.js +6 -6
  54. package/dist/types/ContextMenu.d.ts +4 -1
  55. package/dist/types/Feed.d.ts +55 -1
  56. package/dist/types/ListTable.d.ts +1 -1
  57. package/dist/types/ProjectTreeTable.d.ts +128 -15
  58. package/dist/types/SimpleTable.d.ts +2 -1
  59. package/dist/types/Slicer.d.ts +26 -1
  60. package/dist/types/Views.d.ts +2 -0
  61. package/dist/types/api.d.ts +2359 -590
  62. package/dist/types/components.d.ts +542 -4
  63. package/dist/types/context.d.ts +94 -2
  64. package/dist/types/util.d.ts +58 -0
  65. package/dist/util.es.js +141 -129
  66. package/package.json +2 -2
  67. 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,46 +1,46 @@
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 w } from "react";
2
+ import { bb as C, bq as M, aF as N, aG as x, b5 as q, br as A, bs as F } from "./searchTerms.es.js";
3
+ import { Y as B, cp as I, cC as O, as as P, aw 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) => {
7
- const { entity: i, groupBy: c, extraGroupBys: E, skip: p } = t, n = g(
8
- () => c ? G(c, i) : null,
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
9
  [c, i]
10
10
  ), h = g(() => {
11
11
  if (!n) return;
12
- const s = /* @__PURE__ */ new Set([n.field]), y = [];
12
+ const t = /* @__PURE__ */ new Set([n.field]), y = [];
13
13
  for (const T of E ?? []) {
14
- const v = G(T, i);
15
- v && !s.has(v.field) && (s.add(v.field), y.push(v));
14
+ const v = B(T, i);
15
+ v && !t.has(v.field) && (t.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(
19
- { ...t.entity === "task" ? t.args : { projectName: m }, targets: h },
20
- { skip: u || t.entity !== "task" }
21
- ), S = q(
22
- { ...t.entity === "version" ? t.args : { projectName: m }, targets: h },
23
- { skip: u || t.entity !== "version" }
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);
26
- return s.ungrouped.count > 0 && s.counts.set(U, s.ungrouped), {
27
- counts: o && s.counts.size > 0 ? s.counts : void 0,
28
- total: s.total,
29
- complete: s.complete
18
+ }, [n, E, i]), u = !!p || !n, m = s.args.projectName, k = I(
19
+ { ...s.entity === "task" ? s.args : { projectName: m }, targets: h },
20
+ { skip: u || s.entity !== "task" }
21
+ ), S = O(
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 = P(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,
28
+ total: t.total,
29
+ complete: t.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(s.args), [s.args]);
32
+ return w(() => {
33
33
  f.current.clear(), d.current.clear();
34
- }, [R]), A(() => {
34
+ }, [R]), w(() => {
35
35
  if (u || !n || !o || e.isFetching || l) return;
36
- const s = n.field;
37
- if (d.current.has(s)) return;
38
- if (r.some((T) => T.columnName === Q(s))) {
39
- d.current.add(s);
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
40
  return;
41
41
  }
42
- const y = f.current.get(s) ?? 0;
43
- y >= K || (f.current.set(s, y + 1), e.refetch());
42
+ const y = f.current.get(t) ?? 0;
43
+ y >= K || (f.current.set(t, y + 1), e.refetch());
44
44
  }, [u, n, o, e.isFetching, l, r, e.refetch]), {
45
45
  counts: L,
46
46
  complete: l,
@@ -48,33 +48,33 @@ 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" } = {}) => {
52
- const E = c === "all" ? "all" : [...c].sort().join("\0"), { data: p, isError: n } = M(), h = !!p || n, { requests: u, keyByName: m } = g(() => {
51
+ }, J = (s, { projectName: i, request: c = "all" } = {}) => {
52
+ const E = c === "all" ? "all" : [...c].sort().join("\0"), { data: p, isError: n } = C(), 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
- return t.forEach((a) => {
55
- if (!N(a.data) || e && !e.has(a.name)) return;
54
+ return s.forEach((a) => {
55
+ if (!M(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 = N(a.data, { projectName: i }, l), d = x(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
+ }, [s, E, i, p]), { data: k, isError: S } = q(
62
62
  { requests: u },
63
63
  { skip: !u.length || !h }
64
64
  );
65
- return g(() => m.size ? t.map((e) => {
65
+ return g(() => m.size ? s.map((e) => {
66
66
  const r = m.get(e.name);
67
67
  if (!r) return e;
68
68
  const o = k?.[r];
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 };
75
- }) : t, [t, m, k, S]);
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
+ }) : s, [s, m, k, S]);
76
76
  };
77
77
  export {
78
- Y as a,
79
- H as u
78
+ H as a,
79
+ J as u
80
80
  };
@@ -1,100 +1,126 @@
1
- import { useState as h } from "react";
2
- import { C as F, d as b, a as D } from "./PlayableIcon.es.js";
3
- import { startOfDay as v, parse as m, endOfDay as R, format as l } from "date-fns";
4
- const V = () => {
5
- const [d, y] = h(null), [f, u] = h(""), [g, c] = h(""), p = (r, o) => {
6
- const e = o.find((n) => n.id === r);
7
- if (e?.type === "datetime" && e.values?.length) {
8
- const n = e.values[0];
1
+ import { jsx as D } from "react/jsx-runtime";
2
+ import { p as O, Y as $, M as w, C as F, d as _, a as v } from "./PlayableIcon.es.js";
3
+ import { useState as b } from "react";
4
+ import { startOfDay as x, parse as M, endOfDay as R, format as y } from "date-fns";
5
+ const Z = (c) => c.replace(/\r\n?/g, `
6
+ `).replace(/^\s*(```|~~~).*$/gm, "").replace(/!?\[([^\]]*)\]\((?:\\.|[^)\\])*\)/g, "$1").replace(/<(https?:[^>]+)>/g, "$1").replace(/<\/?[a-z][^>]*>/gi, "").replace(/[<>]/g, "").replace(/&nbsp;/g, " ").replace(/^\s*#{1,6}\s+/gm, "").replace(/^\s*>\s?/gm, "").replace(/^\s*(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?/gm, "").replace(/`([^`]*)`/g, "$1").replace(/(\*\*|__)(.+?)\1/g, "$2").replace(/~~(.+?)~~/g, "$1").replace(/(^|[^\w*\\])\*(?!\s)([^*]+?)\*(?!\w)/g, "$1$2").replace(/(^|[^\w\\])_(?!\s)([^_]+?)_(?!\w)/g, "$1$2").replace(/\\\n/g, `
7
+ `).replace(/\\([\\`*_{}[\]()#+\-.!~>|])/g, "$1").replace(/\s+/g, " ").trim(), B = (c) => {
8
+ const d = (c.node?.children ?? []).filter(
9
+ (p) => !(p.type === "text" && !p.value?.trim())
10
+ );
11
+ if (d.length !== 1) return null;
12
+ const [u] = d;
13
+ if (u.type !== "element" || u.tagName !== "a") return null;
14
+ const i = u.properties?.href, g = u.children?.map((p) => p.value ?? "").join("");
15
+ if (!i || g?.trim() !== i) return null;
16
+ const m = O(i);
17
+ return m ? /* @__PURE__ */ D($, { video: m }) : null;
18
+ }, U = (c, { onOpen: d } = {}) => {
19
+ const u = (c.node?.children ?? []).filter(
20
+ (f) => !(f.type === "text" && !f.value?.trim())
21
+ );
22
+ if (u.length !== 1) return null;
23
+ const [i] = u;
24
+ if (i.type !== "element" || i.tagName !== "img") return null;
25
+ const { src: g, alt: m, title: p } = i.properties ?? {};
26
+ return g ? /* @__PURE__ */ D(w, { src: g, alt: m, mime: p, onOpen: d ? () => d(g) : void 0 }) : null;
27
+ }, j = () => {
28
+ const [c, d] = b(null), [u, i] = b(""), [g, m] = b(""), p = (s, o) => {
29
+ const t = o.find((n) => n.id === s);
30
+ if (t?.type === "datetime" && t.values?.length) {
31
+ const n = t.values[0];
9
32
  if (n.id?.startsWith("custom-")) {
10
- const t = n.id.replace("custom-", ""), a = t.indexOf("Z");
33
+ const e = n.id.replace("custom-", ""), a = e.indexOf("Z");
11
34
  if (a > 0) {
12
- const s = t.substring(0, a + 1), i = t.substring(a + 2);
13
- if (s && i) {
14
- u(
15
- l(m(s, "yyyy-MM-dd'T'HH:mm:ss.SSSx", /* @__PURE__ */ new Date()), "yyyy-MM-dd")
16
- ), c(
17
- l(m(i, "yyyy-MM-dd'T'HH:mm:ss.SSSx", /* @__PURE__ */ new Date()), "yyyy-MM-dd")
18
- ), y(r);
35
+ const r = e.substring(0, a + 1), l = e.substring(a + 2);
36
+ if (r && l) {
37
+ i(
38
+ y(M(r, "yyyy-MM-dd'T'HH:mm:ss.SSSx", /* @__PURE__ */ new Date()), "yyyy-MM-dd")
39
+ ), m(
40
+ y(M(l, "yyyy-MM-dd'T'HH:mm:ss.SSSx", /* @__PURE__ */ new Date()), "yyyy-MM-dd")
41
+ ), d(s);
19
42
  return;
20
43
  }
21
44
  }
22
45
  }
23
46
  }
24
- y(r), u(""), c("");
25
- }, I = (r, o) => {
26
- const e = r.filter((t) => t.type === "datetime"), n = e.find((t) => !t.values?.length);
27
- return n ? n.id : e.length ? e[e.length - 1].id : o.find((t) => t.type === "datetime")?.id ?? null;
47
+ d(s), i(""), m("");
48
+ }, f = (s, o) => {
49
+ const t = s.filter((e) => e.type === "datetime"), n = t.find((e) => !e.values?.length);
50
+ return n ? n.id : t.length ? t[t.length - 1].id : o.find((e) => e.type === "datetime")?.id ?? null;
28
51
  };
29
52
  return {
30
- customRangeFilterId: d,
31
- customStartDate: f,
53
+ customRangeFilterId: c,
54
+ customStartDate: u,
32
55
  customEndDate: g,
33
- setCustomStartDate: u,
34
- setCustomEndDate: c,
56
+ setCustomStartDate: i,
57
+ setCustomEndDate: m,
35
58
  openCustomRangeForFilter: p,
36
- wrapFilterChange: (r, o, e) => {
37
- const n = r.map((t) => t.type === "datetime" && t.values?.some((a) => a.id === D) ? { ...t, values: t.values.filter((a) => a.id !== D) } : t);
38
- e(n);
59
+ wrapFilterChange: (s, o, t) => {
60
+ const n = s.map((e) => e.type === "datetime" && e.values?.some((a) => a.id === v) ? { ...e, values: e.values.filter((a) => a.id !== v) } : e);
61
+ t(n);
39
62
  },
40
- handleSearchBarClickCapture: (r, o) => {
41
- const e = r.target;
42
- if (e.closest(".remove") || e.closest(".button")) return;
43
- const n = e.closest(".search-filter-item");
63
+ handleSearchBarClickCapture: (s, o) => {
64
+ const t = s.target;
65
+ if (t.closest(".remove") || t.closest(".button")) return;
66
+ const n = t.closest(".search-filter-item");
44
67
  if (!n) return;
45
- const t = o.find(
46
- (s) => s.id === n.id && s.type === "datetime" && s.values?.length
68
+ const e = o.find(
69
+ (r) => r.id === n.id && r.type === "datetime" && r.values?.length
47
70
  );
48
- if (!t) return;
49
- const a = t.values?.[0];
71
+ if (!e) return;
72
+ const a = e.values?.[0];
50
73
  if (!(a?.id === "noValue" || a?.id === "hasValue")) {
51
74
  if (a?.id) {
52
- const s = a.id.replace("custom-", ""), i = s.indexOf("Z");
53
- if (i > 0) {
54
- const M = s.substring(0, i + 1), S = s.substring(i + 2);
55
- if (b(M, S)) return;
75
+ const r = a.id.replace("custom-", ""), l = r.indexOf("Z");
76
+ if (l > 0) {
77
+ const h = r.substring(0, l + 1), S = r.substring(l + 2);
78
+ if (_(h, S)) return;
56
79
  }
57
80
  }
58
- r.stopPropagation(), p(t.id, o);
81
+ s.stopPropagation(), p(e.id, o);
59
82
  }
60
83
  },
61
- handleDropdownItemClick: (r, o, e) => {
62
- const n = r.target.closest("li");
84
+ handleDropdownItemClick: (s, o, t) => {
85
+ const n = s.target.closest("li");
63
86
  if (!n) return !0;
64
87
  if (n.querySelector(`span[icon="${F}"]`)) {
65
- const t = n.getAttribute("data-parent") || I(o, e);
66
- return t && p(t, o), !1;
88
+ const e = n.getAttribute("data-parent") || f(o, t);
89
+ return e && p(e, o), !1;
67
90
  }
68
91
  return !0;
69
92
  },
70
- handleCustomRangeApply: (r, o, e, n) => {
71
- if (!d || !f || !g) return;
72
- const t = d.split("__")[0], a = o.find((C) => C.id === t);
93
+ handleCustomRangeApply: (s, o, t, n) => {
94
+ if (!c || !u || !g) return;
95
+ const e = c.split("__")[0], a = o.find((C) => C.id === e);
73
96
  if (!a) return;
74
- const s = v(m(f, "yyyy-MM-dd", /* @__PURE__ */ new Date())), i = R(m(g, "yyyy-MM-dd", /* @__PURE__ */ new Date()));
75
- if (isNaN(s.getTime()) || isNaN(i.getTime()) || i < s) return;
76
- const M = i.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? "MMM d" : "MMM d, yyyy", S = {
77
- id: `custom-${s.toISOString()}-${i.toISOString()}`,
78
- label: `${l(s, "MMM d")} – ${l(i, M)}`,
97
+ const r = x(M(u, "yyyy-MM-dd", /* @__PURE__ */ new Date())), l = R(M(g, "yyyy-MM-dd", /* @__PURE__ */ new Date()));
98
+ if (isNaN(r.getTime()) || isNaN(l.getTime()) || l < r) return;
99
+ const h = l.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? "MMM d" : "MMM d, yyyy", S = {
100
+ id: `custom-${r.toISOString()}-${l.toISOString()}`,
101
+ label: `${y(r, "MMM d")} – ${y(l, h)}`,
79
102
  values: [
80
- { id: s.toISOString(), label: l(s, "MMM d, yyyy") },
81
- { id: i.toISOString(), label: l(i, "MMM d, yyyy") }
103
+ { id: r.toISOString(), label: y(r, "MMM d, yyyy") },
104
+ { id: l.toISOString(), label: y(l, "MMM d, yyyy") }
82
105
  ]
83
- }, O = {
84
- id: d,
106
+ }, I = {
107
+ id: c,
85
108
  type: "datetime",
86
109
  label: a.label,
87
110
  icon: a.icon,
88
111
  values: [S],
89
112
  singleSelect: !0
90
113
  };
91
- e([...r.filter((C) => C.id !== d), O]), y(null), u(""), c(""), n.current?.close();
114
+ t([...s.filter((C) => C.id !== c), I]), d(null), i(""), m(""), n.current?.close();
92
115
  },
93
116
  handleCustomRangeClose: () => {
94
- y(null), u(""), c("");
117
+ d(null), i(""), m("");
95
118
  }
96
119
  };
97
120
  };
98
121
  export {
99
- V as u
122
+ B as a,
123
+ Z as m,
124
+ U as r,
125
+ j as u
100
126
  };
@@ -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 { aT as F, dA as D, dD 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
6
  import { useCallback as k, useState as R, useRef as U } 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,22 +26,22 @@ const N = () => {
25
26
  v || (v = !0, queueMicrotask(() => {
26
27
  v = !1;
27
28
  }));
28
- }, Q = async (e, n, o, t = {}, a, g, f, i) => {
29
+ }, $ = async (e, n, o, t = {}, r, g, f, i) => {
29
30
  const {
30
- viewSettings: c,
31
- viewType: r,
31
+ viewSettings: a,
32
+ viewType: c,
32
33
  projectName: V,
33
34
  selectedView: s,
34
35
  setSelectedView: u,
35
36
  workingView: d,
36
37
  onSettingsChanged: w,
37
38
  isErrorWorkingView: l
38
- } = a;
39
- if (!r) throw new Error("No view type provided for updating view settings");
39
+ } = r;
40
+ if (!c) throw new Error("No view type provided for updating view settings");
40
41
  const p = s?.id, y = s?.working;
41
42
  try {
42
43
  n(o);
43
- const { settings: S, workingViewId: W } = f(), h = S ?? c;
44
+ const { settings: S, workingViewId: W } = f(), h = S ?? a;
44
45
  if (h === void 0 && !l) {
45
46
  console.warn(
46
47
  "updateViewSettings: no settings baseline available, aborting to prevent data loss."
@@ -49,47 +50,47 @@ 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 A = I.id, E = g(
53
54
  {
54
55
  payload: m ? { settings: C } : I,
55
- viewType: r,
56
+ viewType: c,
56
57
  projectName: V
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(A)), 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(), a = k(
68
- async (i, c) => {
69
- if (c) {
70
- const r = {};
67
+ }, z = () => {
68
+ const [e] = F(), [n] = D(), o = L(), t = q(), r = k(
69
+ async (i, a) => {
70
+ if (a) {
71
+ const c = {};
71
72
  return ["label", "owner", "settings"].forEach((s) => {
72
- i.payload[s] !== void 0 && (r[s] = i.payload[s]);
73
+ i.payload[s] !== void 0 && (c[s] = i.payload[s]);
73
74
  }), await n({
74
75
  viewType: i.viewType,
75
76
  projectName: i.projectName,
76
- viewId: c,
77
- payload: r
77
+ viewId: a,
78
+ payload: c
78
79
  }).unwrap();
79
80
  } else
80
81
  return await e(i).unwrap();
81
82
  },
82
83
  [e, n]
83
84
  ), g = k(() => {
84
- const { viewType: i, projectName: c, selectedView: r, workingView: V } = o;
85
+ const { viewType: i, projectName: a, selectedView: c, workingView: V } = o;
85
86
  if (!i) return {};
86
87
  const s = t.getState(), u = b.endpoints.getWorkingView.select({
87
88
  viewType: i,
88
- projectName: c
89
+ projectName: a
89
90
  })(s), w = u?.data?.id || V?.id, l = b.endpoints.getDefaultView.select({
90
91
  viewType: i,
91
- projectName: c
92
- })(s), p = l?.data?.id || r?.id;
92
+ projectName: a
93
+ })(s), p = l?.data?.id || c?.id;
93
94
  return (!!w && p === w || v) && u?.data?.settings ? {
94
95
  settings: u.data.settings,
95
96
  workingViewId: w
@@ -100,29 +101,29 @@ const N = () => {
100
101
  }, [t, o]);
101
102
  return {
102
103
  updateViewSettings: k(
103
- async (...i) => await Q(...i, o, a, g, N),
104
- [o, a, g]
104
+ async (...i) => await $(...i, o, r, g, N),
105
+ [o, r, g]
105
106
  ),
106
- onCreateView: a,
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
- const [t, ...a] = n.split(".");
111
+ }, T = (e, n) => n.split(".").reduce((o, t) => o?.[t], e), j = (e, n, o) => {
112
+ const [t, ...r] = n.split(".");
112
113
  return t ? {
113
114
  ...e,
114
- [t]: a.length ? j(e[t] || {}, a.join("."), o) : o
115
+ [t]: r.length ? j(e[t] || {}, r.join("."), o) : o
115
116
  } : e;
116
- }, ae = (e, n) => {
117
- const { viewSettings: o, isLoadingViews: t } = T(), { updateViewSettings: a, getLatestSettings: g } = $(), [f, i] = R(null), c = U(null), r = o, V = f !== null ? f : L(r, e) ?? n, s = k((d) => {
118
- c.current = d, i(d);
117
+ }, ce = (e, n) => {
118
+ const { viewSettings: o, isLoadingViews: t } = L(), { updateViewSettings: r, getLatestSettings: g } = z(), [f, i] = R(null), a = U(null), c = o, V = f !== null ? f : T(c, e) ?? n, s = k((d) => {
119
+ a.current = d, i(d);
119
120
  }, []), u = k(
120
121
  (d) => {
121
- if (t || !r) return;
122
- const w = g().settings ?? r, l = c.current !== null ? c.current : L(w, e) ?? n, p = typeof d == "function" ? d(
122
+ if (t) return;
123
+ const w = g().settings ?? c ?? {}, l = a.current !== null ? a.current : T(w, e) ?? n, p = typeof d == "function" ? d(
123
124
  l
124
125
  ) : d;
125
- a(
126
+ r(
126
127
  j(w, e, p),
127
128
  s,
128
129
  p,
@@ -134,17 +135,17 @@ const N = () => {
134
135
  g,
135
136
  t,
136
137
  e,
137
- r,
138
+ c,
138
139
  s,
139
- a
140
+ r
140
141
  ]
141
142
  );
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
  };