@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
@@ -10,10 +10,10 @@ import { Dropdown as qe, Icon as Q, InputText as he, Button as pe, InputSwitch a
10
10
  import E from "styled-components";
11
11
  import { a as rt, K as ot } from "./platform.es.js";
12
12
  import "uuid";
13
- import { f as st, g as lt, h as it, p as ct, i as dt } from "./MetaWidget.es.js";
13
+ import { e as st, f as lt, g as it, p as ct, h as dt } from "./MetaWidget.es.js";
14
14
  import Ae from "clsx";
15
15
  import { n as te, b as ft, u as pt } from "./entityDefinitions.es.js";
16
- import { dk as ut } from "./getUris.es.js";
16
+ import { dl as ut } from "./getUris.es.js";
17
17
  import { a as Ee } from "./ProjectContext.es.js";
18
18
  import { u as Be } from "./ProjectFoldersContext.es.js";
19
19
  import { a as mt } from "./MenuContext.es.js";
@@ -185,7 +185,7 @@ const ht = E.div`
185
185
  color: var(--md-sys-color-outline);
186
186
  min-height: 30px;
187
187
  `;
188
- function kt(r, m, u = "") {
188
+ function It(r, m, u = "") {
189
189
  if (r.length <= m)
190
190
  return r.map((d) => u + d).join(", ");
191
191
  {
@@ -206,7 +206,7 @@ function Re(r) {
206
206
  difference: 1
207
207
  };
208
208
  }
209
- const It = ({
209
+ const kt = ({
210
210
  onChange: r,
211
211
  parentId: m = null,
212
212
  children: u,
@@ -229,35 +229,35 @@ const It = ({
229
229
  i?.preventDefault && i?.preventDefault();
230
230
  let { value: C, id: $ } = i.target;
231
231
  $ === "prefixDepth" && (C = parseInt(String(C), 10));
232
- const T = { [$]: C }, k = { ..._, ...T };
232
+ const T = { [$]: C }, I = { ..._, ...T };
233
233
  if ($ === "type") {
234
234
  let P = !1;
235
235
  const c = A.find((j) => j.name === C);
236
236
  for (const j of A) {
237
- if (k.base === "") {
237
+ if (I.base === "") {
238
238
  P = !0;
239
239
  break;
240
240
  }
241
241
  for (const N in j)
242
- if (typeof j[N] == "string" && k.base?.toLowerCase().includes(j[N].toLowerCase())) {
242
+ if (typeof j[N] == "string" && I.base?.toLowerCase().includes(j[N].toLowerCase())) {
243
243
  P = !0;
244
244
  break;
245
245
  }
246
246
  }
247
247
  if (!P || !c) return;
248
248
  const Z = V === "folder" && c.shortName || c.name, M = Re(String(C));
249
- k.base = Z + M.base, k.increment = Z + M.increment, k.length = M.length;
249
+ I.base = Z + M.base, I.increment = Z + M.increment, I.length = M.length;
250
250
  }
251
251
  if ($ === "base") {
252
- const P = Re(k.type), c = String(C), Z = c.replace(/[^a-zA-Z]/g, ""), M = c.replace(/[^0-9]/g, ""), j = parseInt(M, 10), N = M.length, U = Z + (j + P.difference).toString().padStart(N, "0");
253
- k.increment = U.replace("NaN", "");
252
+ const P = Re(I.type), c = String(C), Z = c.replace(/[^a-zA-Z]/g, ""), M = c.replace(/[^0-9]/g, ""), j = parseInt(M, 10), N = M.length, U = Z + (j + P.difference).toString().padStart(N, "0");
253
+ I.increment = U.replace("NaN", "");
254
254
  }
255
255
  if (r(
256
- k,
256
+ I,
257
257
  typeof K == "string" ? K : void 0,
258
258
  V
259
- ), k.base && k.increment && k.length) {
260
- const P = Oe(k.base, k.increment, k.length);
259
+ ), I.base && I.increment && I.length) {
260
+ const P = Oe(I.base, I.increment, I.length);
261
261
  H(P);
262
262
  }
263
263
  $ === "type" && setTimeout(X ? () => {
@@ -276,7 +276,7 @@ const It = ({
276
276
  // eslint-disable-next-line react-hooks/exhaustive-deps
277
277
  []
278
278
  );
279
- const g = kt(de, 5, x ? o : void 0), S = ce(null), [l, b] = z(0);
279
+ const g = It(de, 5, x ? o : void 0), S = ce(null), [l, b] = z(0);
280
280
  return Je(() => {
281
281
  S.current && b(S.current.offsetWidth);
282
282
  }, [S.current, x]), V === "task" ? /* @__PURE__ */ t(
@@ -702,29 +702,29 @@ const It = ({
702
702
  parentFolderIds: s
703
703
  } = jt(), [R, J] = z(!1), { selectedCells: K } = lt() || {}, x = ft(), { getFolderById: ne } = Be(), W = it(), V = W?.getEntityById, X = W?.showHierarchy ?? !0, ae = ge(() => {
704
704
  if (s !== null) return s;
705
- const e = K ? Array.from(K).map((I) => ct(I)) : [], w = Array.from(
705
+ const e = K ? Array.from(K).map((k) => ct(k)) : [], w = Array.from(
706
706
  new Set(
707
- e.filter((I) => I && I.colId !== je).map((I) => I?.rowId).filter(Boolean)
707
+ e.filter((k) => k && k.colId !== je).map((k) => k?.rowId).filter(Boolean)
708
708
  )
709
709
  ), L = Array.from(
710
710
  new Set(
711
- e.filter((I) => I?.colId === je).map((I) => I?.rowId).filter(Boolean)
711
+ e.filter((k) => k?.colId === je).map((k) => k?.rowId).filter(Boolean)
712
712
  )
713
713
  ), le = w.length > 0 ? w : L;
714
714
  if (le.length > 0) {
715
- const I = le.map((G) => V?.(G)), ie = I.filter(
715
+ const k = le.map((G) => V?.(G)), ie = k.filter(
716
716
  (G) => G?.entityType === "folder"
717
- ), Ie = I.filter(
717
+ ), ke = k.filter(
718
718
  (G) => G?.entityType === "task"
719
719
  ), Pe = Array.from(
720
720
  /* @__PURE__ */ new Set([
721
721
  ...ie.map((G) => G.id),
722
- ...Ie.map((G) => G.folderId)
722
+ ...ke.map((G) => G.folderId)
723
723
  ])
724
724
  );
725
725
  if (Pe.length) return Pe;
726
726
  }
727
- return x ? Object.keys(x).filter((I) => x[I]) : [];
727
+ return x ? Object.keys(x).filter((k) => x[k]) : [];
728
728
  }, [s, K, x, V]), de = ge(() => s !== null ? s : x ? Object.keys(x).filter((e) => x[e]) : [], [s, x]), H = n === "folder" && !X ? de : ae, Y = ae.length > 0, ee = ge(
729
729
  () => H.map((e) => {
730
730
  const w = V?.(e) || ne(e);
@@ -734,18 +734,18 @@ const It = ({
734
734
  ), [B, a] = z(null);
735
735
  let f = B !== null ? B : H;
736
736
  f = f.filter((e) => H.includes(e)), f.length === 0 && H.length > 0 && (f = H);
737
- const g = f.map((e) => ee.find((w) => w.value === e)?.label || "").filter(Boolean), S = g[0] || "", l = Te(H), [b, i] = z(!1), [C, $] = z(!1), T = { label: "", subType: "", name: "" }, k = () => {
737
+ const g = f.map((e) => ee.find((w) => w.value === e)?.label || "").filter(Boolean), S = g[0] || "", l = Te(H), [b, i] = z(!1), [C, $] = z(!1), T = { label: "", subType: "", name: "" }, I = () => {
738
738
  let e = "Add New ";
739
739
  return l && n === "folder" && (e += "Root "), e += n ? te[n].label : "", l || (g.length > 2 ? e += " - " + g.slice(0, 2).join(", ") + ` +${g.length - 2} more` : e += " - " + g.join(", ")), e;
740
740
  }, P = (n === "folder" ? h?.folderTypes : h?.taskTypes) || [], c = (e, w) => {
741
741
  if (!w) return;
742
742
  let L = { ...o };
743
743
  if (L[w] = e, e && w === "subType") {
744
- const le = P.find((ie) => ie.name === o.subType), I = P.find((ie) => ie.name === e);
745
- if (I && o.label === le?.name) {
746
- L.label = I.name;
747
- const Ie = be(o.label, q);
748
- o.name === Ie && (L.name = be(L.label, q));
744
+ const le = P.find((ie) => ie.name === o.subType), k = P.find((ie) => ie.name === e);
745
+ if (k && o.label === le?.name) {
746
+ L.label = k.name;
747
+ const ke = be(o.label, q);
748
+ o.name === ke && (L.name = be(L.label, q));
749
749
  }
750
750
  setTimeout(() => {
751
751
  j.current?.focus();
@@ -775,8 +775,8 @@ const It = ({
775
775
  }
776
776
  ye(!0);
777
777
  try {
778
- const I = await A(f);
779
- console.log(I), m?.(I, e), e ? (j.current && (j.current.focus(), j.current.select()), $(!1)) : N();
778
+ const k = await A(f);
779
+ console.log(k), m?.(k, e), e ? (j.current && (j.current.focus(), j.current.select()), $(!1)) : N();
780
780
  } catch {
781
781
  } finally {
782
782
  ye(!1);
@@ -818,7 +818,7 @@ const It = ({
818
818
  const He = (e) => {
819
819
  const w = ve.find((L) => L.value === e);
820
820
  w && !w.disabled && _(w.type, { isSequence: w.isSequence });
821
- }, ke = n === "task" && Te(f), Ue = !o.label || !o.subType || ke;
821
+ }, Ie = n === "task" && Te(f), Ue = !o.label || !o.subType || Ie;
822
822
  return /* @__PURE__ */ p(ue, { children: [
823
823
  u && /* @__PURE__ */ t(
824
824
  qt,
@@ -852,7 +852,7 @@ const It = ({
852
852
  d && n && /* @__PURE__ */ t(
853
853
  Ot,
854
854
  {
855
- header: k(),
855
+ header: I(),
856
856
  isOpen: !0,
857
857
  onClose: N,
858
858
  onShow: U,
@@ -888,8 +888,8 @@ const It = ({
888
888
  label: te[n].createLabel,
889
889
  onClick: () => se(R),
890
890
  active: !Ue || oe,
891
- disabled: !o.name || !o.label || ke,
892
- "data-tooltip": ke ? "Select a parent folder" : void 0,
891
+ disabled: !o.name || !o.label || Ie,
892
+ "data-tooltip": Ie ? "Select a parent folder" : void 0,
893
893
  "data-shortcut": rt("Enter", [ot.Ctrl]),
894
894
  saving: oe
895
895
  }
@@ -925,7 +925,7 @@ const It = ({
925
925
  y.active ? (
926
926
  // @ts-ignore
927
927
  /* @__PURE__ */ t(
928
- It,
928
+ kt,
929
929
  {
930
930
  base: o.label,
931
931
  type: o.subType,
@@ -1044,26 +1044,26 @@ const It = ({
1044
1044
  const S = /* @__PURE__ */ new Map();
1045
1045
  for (const T of g) {
1046
1046
  if (!T) continue;
1047
- const k = v(
1047
+ const I = v(
1048
1048
  T,
1049
1049
  d.map((P) => P.name)
1050
1050
  );
1051
- S.set(T, k);
1051
+ S.set(T, I);
1052
1052
  }
1053
- const l = a.filter((T) => T.entityType === "folder"), b = a.filter((T) => T.entityType === "task"), i = (T, k) => {
1053
+ const l = a.filter((T) => T.entityType === "folder"), b = a.filter((T) => T.entityType === "task"), i = (T, I) => {
1054
1054
  let P = [];
1055
1055
  for (const c of T) {
1056
- const Z = k === "folder" ? c.data.parentId : c.data.folderId, M = S.get(Z) || n, j = Object.keys(M).reduce((N, U) => {
1056
+ const Z = I === "folder" ? c.data.parentId : c.data.folderId, M = S.get(Z) || n, j = Object.keys(M).reduce((N, U) => {
1057
1057
  const oe = d.find((fe) => fe.name === U);
1058
1058
  if (!oe) return N;
1059
- const ye = oe.scope?.includes(k), se = !!oe.data.inherit;
1059
+ const ye = oe.scope?.includes(I), se = !!oe.data.inherit;
1060
1060
  return ye ? N[U] = M[U] : se && M[U] && (N[U] = {
1061
1061
  ...M[U],
1062
1062
  inherited: !0,
1063
1063
  inheritedFrom: Z
1064
1064
  }), N;
1065
1065
  }, {});
1066
- if (k === "folder") {
1066
+ if (I === "folder") {
1067
1067
  let N = c.data.parentId && f[c.data.parentId];
1068
1068
  N = N ? N + "/" + c.data.name : "";
1069
1069
  const U = {