@ynput/ayon-frontend-shared 0.5.0 → 0.6.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 (74) hide show
  1. package/dist/DetailsPanel.es.js +88 -86
  2. package/dist/Feed.es.js +22 -22
  3. package/dist/ListTable.es.js +77 -67
  4. package/dist/ProjectTreeTable.es.js +1164 -1150
  5. package/dist/Slicer.es.js +2 -2
  6. package/dist/Views.es.js +1 -1
  7. package/dist/api.es.js +331 -329
  8. package/dist/chunks/Actions.es.js +23 -23
  9. package/dist/chunks/DeleteEntitiesContext.es.js +115 -115
  10. package/dist/chunks/DetailsDialog.es.js +3 -3
  11. package/dist/chunks/DetailsPanelContext.es.js +155 -0
  12. package/dist/chunks/EntityPath.es.js +20 -20
  13. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  14. package/dist/chunks/EntityTooltip.es.js +12 -12
  15. package/dist/chunks/EntityUpdatesContext.es.js +1 -1
  16. package/dist/chunks/Feed.es.js +2208 -2611
  17. package/dist/chunks/FilterErrorActions.es.js +1 -1
  18. package/dist/chunks/GlobalContext.es.js +14 -14
  19. package/dist/chunks/Menu.es.js +1 -1
  20. package/dist/chunks/MenuContext.es.js +51 -242
  21. package/dist/chunks/MenuItem.es.js +1 -1
  22. package/dist/chunks/MetaWidget.es.js +3341 -3899
  23. package/dist/chunks/NewEntityContext.es.js +40 -40
  24. package/dist/chunks/PlayableIcon.es.js +4261 -1163
  25. package/dist/chunks/ProjectContext.es.js +13 -13
  26. package/dist/chunks/ProjectFoldersContext.es.js +5 -5
  27. package/dist/chunks/RepresentationsList.es.js +3 -3
  28. package/dist/chunks/ReviewablesSelector.es.js +85 -76
  29. package/dist/chunks/SimpleForm.es.js +9 -9
  30. package/dist/chunks/SimpleTable.es.js +1 -1
  31. package/dist/chunks/Slicer.es.js +173 -171
  32. package/dist/chunks/TableSettingsFallback.es.js +6 -6
  33. package/dist/chunks/ThumbnailSimple.es.js +410 -61
  34. package/dist/chunks/VersionUploadContext.es.js +29 -29
  35. package/dist/chunks/ViewsContext.es.js +90 -90
  36. package/dist/chunks/Watchers.es.js +628 -598
  37. package/dist/chunks/entityDefinitions.es.js +31 -31
  38. package/dist/chunks/expandRelativeDates.es.js +27 -0
  39. package/dist/chunks/getBundleMode.es.js +16 -61
  40. package/dist/chunks/getUris.es.js +271 -269
  41. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  42. package/dist/chunks/searchTerms.es.js +177 -173
  43. package/dist/chunks/uriUtils.es.js +48 -0
  44. package/dist/chunks/useAttributeEnums.es.js +11 -11
  45. package/dist/chunks/useColumnDragRestriction.es.js +37 -27
  46. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  47. package/dist/chunks/useLocalStorage.es.js +9 -9
  48. package/dist/chunks/useSessionStorage.es.js +61 -0
  49. package/dist/chunks/viewUpdateHelper.es.js +19 -19
  50. package/dist/components.es.js +165 -160
  51. package/dist/context.es.js +60 -58
  52. package/dist/hooks.es.js +104 -98
  53. package/dist/index.es.js +18 -13
  54. package/dist/types/Actions.d.ts +16 -16
  55. package/dist/types/ContextMenu.d.ts +16 -16
  56. package/dist/types/DetailsPanel.d.ts +16 -16
  57. package/dist/types/EntityPickerDialog.d.ts +16 -16
  58. package/dist/types/Feed.d.ts +16 -16
  59. package/dist/types/ListTable.d.ts +16 -16
  60. package/dist/types/NewEntity.d.ts +16 -16
  61. package/dist/types/ProjectTreeTable.d.ts +20 -16
  62. package/dist/types/RepresentationsList.d.ts +16 -16
  63. package/dist/types/SimpleTable.d.ts +16 -16
  64. package/dist/types/Slicer.d.ts +16 -16
  65. package/dist/types/Views.d.ts +17 -17
  66. package/dist/types/api.d.ts +391 -95
  67. package/dist/types/components.d.ts +79 -20
  68. package/dist/types/context.d.ts +60 -17
  69. package/dist/types/hooks.d.ts +16 -16
  70. package/dist/types/index.d.ts +16 -16
  71. package/dist/types/util.d.ts +16 -16
  72. package/dist/util.es.js +108 -97
  73. package/package.json +16 -4
  74. package/dist/chunks/mentionTypeOptions.es.js +0 -15
@@ -0,0 +1,48 @@
1
+ const d = (t) => {
2
+ const n = t.split("://")[1].split("?"), s = n[0], e = n[1];
3
+ return {
4
+ baseUri: s,
5
+ queryParams: new URLSearchParams(e || "")
6
+ };
7
+ }, g = ({
8
+ projectName: t,
9
+ folderPath: n,
10
+ taskName: s,
11
+ productName: e,
12
+ versionName: a
13
+ }) => {
14
+ const r = new URL(`ayon+entity://${t}/${n}`);
15
+ return s && r.searchParams.append("task", s), e && r.searchParams.append("product", e), a && r.searchParams.append("version", a), r.toString();
16
+ }, y = (t) => {
17
+ const { baseUri: n, queryParams: s } = d(t), e = n.split("/"), a = e[0], r = e.slice(1), [i, c] = a.split(":"), p = s.get("site") ?? void 0, o = s.get("project") ?? void 0;
18
+ return {
19
+ addonName: i,
20
+ addonVersion: c,
21
+ settingsPath: r,
22
+ site: p,
23
+ project: o
24
+ };
25
+ }, l = (t) => {
26
+ const { baseUri: n, queryParams: s } = d(t), e = n.split("/"), a = e[0], r = e.slice(1).join("/"), i = s.get("task") ?? void 0, c = s.get("product") ?? void 0, p = s.get("version") ?? void 0;
27
+ let o;
28
+ return p ? o = "version" : c ? o = "product" : i ? o = "task" : o = "folder", {
29
+ projectName: a,
30
+ entityType: o,
31
+ folderPath: r,
32
+ taskName: i,
33
+ productName: c,
34
+ versionName: p
35
+ };
36
+ }, u = (t) => t ? t.startsWith("ayon+settings://") ? {
37
+ type: "settings",
38
+ settings: y(t)
39
+ } : t.startsWith("ayon+entity://") ? {
40
+ type: "entity",
41
+ entity: l(t)
42
+ } : { type: void 0 } : { type: void 0 };
43
+ export {
44
+ y as a,
45
+ g as b,
46
+ l as g,
47
+ u as p
48
+ };
@@ -1,9 +1,9 @@
1
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";
2
+ import { b1 as G, bh as M, aw as N, ax as C, aX as I, bi as A, bj as O } from "./searchTerms.es.js";
3
+ import { W as B, ci as P, cv as q, ao as F, as as Q } from "./getUris.es.js";
4
4
  import "primereact/confirmdialog";
5
5
  import { U } from "./MetaWidget.es.js";
6
- const z = [], K = 3, H = (s) => {
6
+ const j = [], z = 3, H = (s) => {
7
7
  const { entity: i, groupBy: c, extraGroupBys: E, skip: p } = s, n = g(
8
8
  () => c ? B(c, i) : null,
9
9
  [c, i]
@@ -11,17 +11,17 @@ const z = [], K = 3, H = (s) => {
11
11
  if (!n) return;
12
12
  const t = /* @__PURE__ */ new Set([n.field]), y = [];
13
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));
14
+ const S = B(T, i);
15
+ S && !t.has(S.field) && (t.add(S.field), y.push(S));
16
16
  }
17
17
  return [n, ...y];
18
18
  }, [n, E, i]), u = !!p || !n, m = s.args.projectName, k = P(
19
19
  { ...s.entity === "task" ? s.args : { projectName: m }, targets: h },
20
20
  { skip: u || s.entity !== "task" }
21
- ), S = q(
21
+ ), v = q(
22
22
  { ...s.entity === "version" ? s.args : { projectName: m }, targets: h },
23
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(() => {
24
+ ), e = s.entity === "task" ? k : v, r = e.data ?? j, o = !!e.data, { counts: L, total: a, complete: l } = g(() => {
25
25
  const t = F(r, n);
26
26
  return t.ungrouped.count > 0 && t.counts.set(U, t.ungrouped), {
27
27
  counts: o && t.counts.size > 0 ? t.counts : void 0,
@@ -40,7 +40,7 @@ const z = [], K = 3, H = (s) => {
40
40
  return;
41
41
  }
42
42
  const y = f.current.get(t) ?? 0;
43
- y >= K || (f.current.set(t, y + 1), e.refetch());
43
+ y >= z || (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,
@@ -58,7 +58,7 @@ const z = [], K = 3, H = (s) => {
58
58
  )?.acceptedParams, f = N(a.data, { projectName: i }, l), d = C(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
- }, [s, E, i, p]), { data: k, isError: S } = I(
61
+ }, [s, E, i, p]), { data: k, isError: v } = I(
62
62
  { requests: u },
63
63
  { skip: !u.length || !h }
64
64
  );
@@ -71,8 +71,8 @@ const z = [], K = 3, H = (s) => {
71
71
  enumIsLoading: !1,
72
72
  enumError: o.error ? A(o.error) : void 0,
73
73
  data: { ...e.data, enum: O(o.items) }
74
- } : S ? { ...e, enumIsLoading: !1, enumError: A() } : { ...e, enumIsLoading: !0 };
75
- }) : s, [s, m, k, S]);
74
+ } : v ? { ...e, enumIsLoading: !1, enumError: A() } : { ...e, enumIsLoading: !0 };
75
+ }) : s, [s, m, k, v]);
76
76
  };
77
77
  export {
78
78
  H as a,
@@ -3,17 +3,27 @@ import "react-toastify";
3
3
  import "lodash";
4
4
  import "primereact/confirmdialog";
5
5
  import { g as a } from "./parseHtmlToPlainTextWithLinks.es.js";
6
- import { bf as C } from "./searchTerms.es.js";
6
+ import { bg as C } from "./searchTerms.es.js";
7
7
  import "uuid";
8
8
  import "react/jsx-runtime";
9
9
  import "clsx";
10
10
  import "./PlayableIcon.es.js";
11
11
  import "@ynput/ayon-react-components";
12
+ import "lexical";
13
+ import "@lexical/markdown";
14
+ import "@lexical/react/LexicalBlockWithAlignableContents";
15
+ import "@lexical/react/LexicalDecoratorBlockNode";
16
+ import "match-sorter";
17
+ import "date-fns";
18
+ import "@lexical/code";
19
+ import "@lexical/list";
20
+ import "@lexical/rich-text";
21
+ import "@lexical/selection";
22
+ import "@lexical/utils";
23
+ import "./getUris.es.js";
12
24
  import "react-router-dom";
13
25
  import { u as k, a as v } from "./MetaWidget.es.js";
14
- import "date-fns";
15
26
  import "./ProjectContext.es.js";
16
- import "./getUris.es.js";
17
27
  import "@tanstack/react-table";
18
28
  import "./useCreateContextMenu.es.js";
19
29
  import "./DeleteEntitiesContext.es.js";
@@ -22,12 +32,12 @@ import "./useLocalStorage.es.js";
22
32
  import "@module-federation/enhanced/runtime";
23
33
  import "semver";
24
34
  import "./ProjectFoldersContextInstance.es.js";
25
- const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(n.data.type || "") && (!s || n.scope?.includes(s)) ? o ? C(n.data) : !0 : !1, Z = ({
26
- allowedTypes: n,
35
+ const E = ["string", "integer", "float"], L = (o, s, r, n) => (r || E).includes(o.data.type || "") && (!s || o.scope?.includes(s)) ? n ? C(o.data) : !0 : !1, lt = ({
36
+ allowedTypes: o,
27
37
  enumOnly: s,
28
38
  scope: r
29
39
  }) => {
30
- const { columnOrder: o } = k(), { attribFields: l } = v();
40
+ const { columnOrder: n } = k(), { attribFields: l } = v();
31
41
  return x(
32
42
  () => [
33
43
  {
@@ -78,41 +88,41 @@ const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(
78
88
  icon: a("tags"),
79
89
  scopes: ["task", "version", "folder", "product"]
80
90
  },
81
- ...l.filter((t) => L(t, r, n, s)).map((t) => ({
91
+ ...l.filter((t) => L(t, r, o, s)).map((t) => ({
82
92
  value: "attrib." + t.name,
83
93
  label: t.data.title || t.name,
84
94
  icon: a(t.name)
85
95
  }))
86
96
  ].filter((t) => !r || ("scopes" in t ? t.scopes.includes(r) : !0)).sort((t, b) => {
87
- const c = o.indexOf(t.value), p = o.indexOf(b.value);
97
+ const c = n.indexOf(t.value), p = n.indexOf(b.value);
88
98
  return c === -1 && p === -1 ? 0 : c === -1 ? 1 : p === -1 ? -1 : c - p;
89
99
  }),
90
- [l, o, n, s, r]
100
+ [l, n, o, s, r]
91
101
  );
92
- }, S = "data-column-dnd-container", A = 100, z = ({
93
- columnPinning: n,
102
+ }, S = "data-column-dnd-container", A = 100, ut = ({
103
+ columnPinning: o,
94
104
  columnSizing: s
95
105
  }) => {
96
- const r = T(null), o = T(null), l = d(() => {
97
- const e = n.left || [];
106
+ const r = T(null), n = T(null), l = d(() => {
107
+ const e = o.left || [];
98
108
  let i = 24;
99
109
  return e.forEach((h) => {
100
110
  i += s[h] || 150;
101
111
  }), i;
102
- }, [n.left, s]), t = d(
112
+ }, [o.left, s]), t = d(
103
113
  ({ transform: e, activeNodeRect: i, draggingNodeRect: h, active: y }) => {
104
114
  if (r.current === null || !i || y?.data.current?.type && y.data.current.type !== "column") return e;
105
- let f = o.current;
106
- f === null && (f = (document.querySelector(`[${S}]`)?.getBoundingClientRect().left ?? 0) + l());
107
- const m = h?.left ?? i.left;
115
+ let m = n.current;
116
+ m === null && (m = (document.querySelector(`[${S}]`)?.getBoundingClientRect().left ?? 0) + l());
117
+ const f = h?.left ?? i.left;
108
118
  if (r.current) {
109
- const g = m + i.width + e.x, u = f + A;
119
+ const g = f + i.width + e.x, u = m + A;
110
120
  if (g > u)
111
- return { ...e, x: u - m - i.width };
121
+ return { ...e, x: u - f - i.width };
112
122
  } else {
113
- const g = m + e.x, u = f - A;
123
+ const g = f + e.x, u = m - A;
114
124
  if (g < u)
115
- return { ...e, x: u - m };
125
+ return { ...e, x: u - f };
116
126
  }
117
127
  return e;
118
128
  },
@@ -123,13 +133,13 @@ const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(
123
133
  r.current = null;
124
134
  return;
125
135
  }
126
- r.current = n.left?.includes(e) || !1;
136
+ r.current = o.left?.includes(e) || !1;
127
137
  },
128
- [n.left]
138
+ [o.left]
129
139
  ), c = d(() => {
130
- r.current = null, o.current = null;
140
+ r.current = null, n.current = null;
131
141
  }, []), p = d((e) => {
132
- o.current = e;
142
+ n.current = e;
133
143
  }, []);
134
144
  return {
135
145
  restrictToSection: t,
@@ -142,7 +152,7 @@ const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(
142
152
  export {
143
153
  S as T,
144
154
  E as a,
145
- Z as b,
155
+ lt as b,
146
156
  L as i,
147
- z as u
157
+ ut as u
148
158
  };
@@ -1,5 +1,5 @@
1
1
  import { useState as h } from "react";
2
- import { C as b, d as F, b as D } from "./PlayableIcon.es.js";
2
+ import { C as F, d as b, a as D } from "./PlayableIcon.es.js";
3
3
  import { startOfDay as v, parse as m, endOfDay as R, format as l } from "date-fns";
4
4
  const V = () => {
5
5
  const [d, y] = h(null), [f, u] = h(""), [g, c] = h(""), p = (r, o) => {
@@ -52,7 +52,7 @@ const V = () => {
52
52
  const s = a.id.replace("custom-", ""), i = s.indexOf("Z");
53
53
  if (i > 0) {
54
54
  const M = s.substring(0, i + 1), S = s.substring(i + 2);
55
- if (F(M, S)) return;
55
+ if (b(M, S)) return;
56
56
  }
57
57
  }
58
58
  r.stopPropagation(), p(t.id, o);
@@ -61,7 +61,7 @@ const V = () => {
61
61
  handleDropdownItemClick: (r, o, e) => {
62
62
  const n = r.target.closest("li");
63
63
  if (!n) return !0;
64
- if (n.querySelector(`span[icon="${b}"]`)) {
64
+ if (n.querySelector(`span[icon="${F}"]`)) {
65
65
  const t = n.getAttribute("data-parent") || I(o, e);
66
66
  return t && p(t, o), !1;
67
67
  }
@@ -1,12 +1,12 @@
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";
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 E } from "react";
3
3
  import { registerRemotes as O, loadRemote as j } from "@module-federation/enhanced/runtime";
4
4
  import "./searchTerms.es.js";
5
- import { cP as M } from "./getUris.es.js";
5
+ import { cQ 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 = k({
9
+ const x = P({
10
10
  isLoading: !0,
11
11
  modules: [],
12
12
  remotesInitialized: !1
@@ -42,7 +42,7 @@ const x = k({
42
42
  type: "module"
43
43
  }))
44
44
  ), i(!0);
45
- }, [o, c, d, n]), /* @__PURE__ */ P(
45
+ }, [o, c, d, n]), /* @__PURE__ */ k(
46
46
  x.Provider,
47
47
  {
48
48
  value: {
@@ -231,7 +231,7 @@ const x = k({
231
231
  description: "Aggregate each column totals, averages, distributions in a summary footer.",
232
232
  bullet: "Per-column summary footer"
233
233
  }
234
- }, z = k(void 0), X = ({
234
+ }, z = P(void 0), X = ({
235
235
  children: e,
236
236
  debug: t
237
237
  }) => {
@@ -276,7 +276,7 @@ const x = k({
276
276
  }),
277
277
  [p, o, r, i, w]
278
278
  );
279
- return /* @__PURE__ */ P(z.Provider, { value: R, children: e });
279
+ return /* @__PURE__ */ k(z.Provider, { value: R, children: e });
280
280
  }, Y = () => {
281
281
  const e = I(z);
282
282
  if (e === void 0)
@@ -343,13 +343,13 @@ function te(e, t) {
343
343
  export {
344
344
  X as P,
345
345
  _ as R,
346
- $ as a,
346
+ Y as a,
347
347
  T as b,
348
348
  V as c,
349
349
  N as d,
350
350
  te as e,
351
351
  K as p,
352
352
  Z as r,
353
- Y as u,
353
+ $ as u,
354
354
  ee as w
355
355
  };
@@ -0,0 +1,61 @@
1
+ import { useRef as w, useState as f, useEffect as S, useCallback as m } from "react";
2
+ const i = (e, t = null) => {
3
+ if (!e) return t;
4
+ try {
5
+ return JSON.parse(e);
6
+ } catch {
7
+ return t;
8
+ }
9
+ }, E = (e, t) => {
10
+ if (typeof window > "u") return t;
11
+ try {
12
+ return i(sessionStorage.getItem(e), t);
13
+ } catch {
14
+ return t;
15
+ }
16
+ }, h = (e, t) => {
17
+ if (!(typeof window > "u"))
18
+ try {
19
+ sessionStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } }));
20
+ } catch (r) {
21
+ console.error(r);
22
+ }
23
+ };
24
+ function v(e, t) {
25
+ const r = w(t);
26
+ r.current = t;
27
+ const [c, u] = f(() => typeof window > "u" ? t : i(sessionStorage.getItem(e), t));
28
+ S(() => {
29
+ const o = sessionStorage.getItem(e);
30
+ u(i(o, r.current)), o || sessionStorage.setItem(e, JSON.stringify(r.current));
31
+ function n(s) {
32
+ if ("key" in s && s.key && s.key !== e) return;
33
+ const a = s.detail?.key;
34
+ if (a && a !== e) return;
35
+ const g = sessionStorage.getItem(e);
36
+ u(i(g, r.current));
37
+ }
38
+ return window.addEventListener("session-storage", n), window.addEventListener("storage", n), () => {
39
+ window.removeEventListener("session-storage", n), window.removeEventListener("storage", n);
40
+ };
41
+ }, [e]);
42
+ const d = m(
43
+ (o) => {
44
+ try {
45
+ u((n) => {
46
+ const s = typeof o == "function" ? o(n) : o;
47
+ return sessionStorage.setItem(e, JSON.stringify(s)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), s;
48
+ });
49
+ } catch (n) {
50
+ console.error(n);
51
+ }
52
+ },
53
+ [e]
54
+ );
55
+ return [c, d];
56
+ }
57
+ export {
58
+ E as r,
59
+ v as u,
60
+ h as w
61
+ };
@@ -1,5 +1,5 @@
1
1
  import "./searchTerms.es.js";
2
- import { aP as A, dr as D, du as M } from "./getUris.es.js";
2
+ import { aP as A, ds as D, dv 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";
@@ -10,13 +10,13 @@ const b = () => {
10
10
  m || (m = !0, queueMicrotask(() => {
11
11
  m = !1;
12
12
  }));
13
- }, q = async (e, n, o, t = {}, a, u, f, s) => {
13
+ }, q = async (e, n, o, t = {}, a, g, f, s) => {
14
14
  const {
15
15
  viewSettings: c,
16
16
  viewType: r,
17
17
  projectName: V,
18
18
  selectedView: i,
19
- setSelectedView: g,
19
+ setSelectedView: u,
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 = u(
37
+ const E = h.id, F = g(
38
38
  {
39
39
  payload: k ? { settings: C } : h,
40
40
  viewType: r,
@@ -42,9 +42,9 @@ const b = () => {
42
42
  },
43
43
  k
44
44
  );
45
- s(), (!y || i?.id !== k) && (i && w(!0), g(E)), await F, n(null), t.successMessage && N.success(t.successMessage);
45
+ s(), (!y || i?.id !== k) && (i && w(!0), u(E)), await F, n(null), t.successMessage && N.success(t.successMessage);
46
46
  } catch (S) {
47
- n(null), p && g(p), i && !y && w(!1);
47
+ n(null), p && u(p), i && !y && w(!1);
48
48
  const W = t.errorMessage || `Failed to update view settings: ${S}`;
49
49
  N.error(W);
50
50
  }
@@ -65,18 +65,18 @@ const b = () => {
65
65
  return await e(s).unwrap();
66
66
  },
67
67
  [e, n]
68
- ), u = v(() => {
68
+ ), g = v(() => {
69
69
  const { viewType: s, projectName: c, selectedView: r, workingView: V } = o;
70
70
  if (!s) return {};
71
- const i = t.getState(), g = M.endpoints.getWorkingView.select({
71
+ const i = t.getState(), u = M.endpoints.getWorkingView.select({
72
72
  viewType: s,
73
73
  projectName: c
74
- })(i), w = g?.data?.id || V?.id, l = M.endpoints.getDefaultView.select({
74
+ })(i), w = u?.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) && g?.data?.settings ? {
79
- settings: g.data.settings,
78
+ return (!!w && p === w || m) && u?.data?.settings ? {
79
+ settings: u.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 q(...s, o, a, u, b),
89
- [o, a, u]
88
+ async (...s) => await q(...s, o, a, g, b),
89
+ [o, a, g]
90
90
  ),
91
91
  onCreateView: a,
92
- getLatestSettings: u,
92
+ getLatestSettings: g,
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: u } = x(), [f, s] = P(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: g } = 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
- }, []), g = v(
104
+ }, []), u = v(
105
105
  (d) => {
106
106
  if (t || !r) return;
107
- const w = u().settings ?? r, l = c.current !== null ? c.current : L(w, e) ?? n, p = typeof d == "function" ? d(
107
+ const w = g().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
- u,
119
+ g,
120
120
  t,
121
121
  e,
122
122
  r,
@@ -124,7 +124,7 @@ const b = () => {
124
124
  a
125
125
  ]
126
126
  );
127
- return [V, g];
127
+ return [V, u];
128
128
  };
129
129
  export {
130
130
  x as a,