@ynput/ayon-frontend-shared 0.7.6 → 0.8.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 (70) hide show
  1. package/dist/DetailsPanel.es.js +361 -355
  2. package/dist/Feed.es.js +1 -1
  3. package/dist/ListTable.es.js +18 -18
  4. package/dist/NewEntity.es.js +30 -30
  5. package/dist/ProjectTreeTable.es.js +984 -974
  6. package/dist/ProjectsTable.es.js +3 -3
  7. package/dist/Slicer.es.js +53 -50
  8. package/dist/Views.es.js +150 -151
  9. package/dist/api.es.js +166 -165
  10. package/dist/chunks/Actions.es.js +9 -10
  11. package/dist/chunks/ColumnDropIndicator.es.js +2 -2
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +3 -4
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
  14. package/dist/chunks/DetailsDialog.es.js +3 -3
  15. package/dist/chunks/EmptyPlaceholder.es.js +7 -7
  16. package/dist/chunks/EntityPath.es.js +38 -39
  17. package/dist/chunks/EntityPickerDialog.es.js +65 -66
  18. package/dist/chunks/EntityTooltip.es.js +18 -19
  19. package/dist/chunks/Feed.es.js +1381 -1355
  20. package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
  21. package/dist/chunks/FilterErrorActions.es.js +2 -3
  22. package/dist/chunks/GroupSettingsFallback.es.js +2 -2
  23. package/dist/chunks/Menu.es.js +52 -53
  24. package/dist/chunks/MetaWidget.es.js +1948 -1875
  25. package/dist/chunks/ProjectFoldersContext.es.js +40 -40
  26. package/dist/chunks/RepresentationsList.es.js +1 -1
  27. package/dist/chunks/ReviewablesSelector.es.js +759 -742
  28. package/dist/chunks/SimpleTable.es.js +2 -1
  29. package/dist/chunks/Slicer.es.js +49 -50
  30. package/dist/chunks/TableExportContextInstance.es.js +600 -402
  31. package/dist/chunks/TableSettingsFallback.es.js +3 -4
  32. package/dist/chunks/ThumbnailSimple.es.js +114 -99
  33. package/dist/chunks/VideoPlayer.es.js +8 -9
  34. package/dist/chunks/Watchers.es.js +928 -871
  35. package/dist/chunks/expandRelativeDates.es.js +1 -1
  36. package/dist/chunks/getThumbnailUrl.es.js +33 -21
  37. package/dist/chunks/getUris.es.js +1580 -1610
  38. package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
  39. package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
  40. package/dist/chunks/searchTerms.es.js +773 -696
  41. package/dist/chunks/useAttributeEnums.es.js +22 -22
  42. package/dist/chunks/useDateRangeFilter.es.js +1 -1
  43. package/dist/chunks/useHierarchySelection.es.js +3 -4
  44. package/dist/chunks/useLoadModule.es.js +3 -4
  45. package/dist/components.es.js +475 -467
  46. package/dist/context.es.js +615 -540
  47. package/dist/hooks.es.js +193 -171
  48. package/dist/index.es.js +2 -2
  49. package/dist/types/Actions.d.ts +10 -8
  50. package/dist/types/DetailsPanel.d.ts +54 -76
  51. package/dist/types/EntityPickerDialog.d.ts +12 -6
  52. package/dist/types/Feed.d.ts +24 -24
  53. package/dist/types/ListTable.d.ts +33 -27
  54. package/dist/types/NewEntity.d.ts +26 -39
  55. package/dist/types/ProjectTreeTable.d.ts +199 -195
  56. package/dist/types/ProjectsTable.d.ts +6 -6
  57. package/dist/types/RepresentationsList.d.ts +4 -0
  58. package/dist/types/Slicer.d.ts +63 -246
  59. package/dist/types/Views.d.ts +71 -298
  60. package/dist/types/api.d.ts +3164 -2363
  61. package/dist/types/components.d.ts +327 -474
  62. package/dist/types/context.d.ts +285 -572
  63. package/dist/types/hooks.d.ts +76 -47
  64. package/dist/types/index.d.ts +6 -0
  65. package/dist/types/util.d.ts +141 -120
  66. package/dist/util.es.js +71 -68
  67. package/package.json +6 -6
  68. package/dist/chunks/EntityUpdatesContext.es.js +0 -61
  69. package/dist/chunks/PlayableIcon.es.js +0 -5020
  70. package/dist/chunks/viewUpdateHelper.es.js +0 -153
@@ -831,7 +831,8 @@ const tn = ({
831
831
  data: Fe,
832
832
  columns: Ae,
833
833
  state: {
834
- expanded: te,
834
+ // while searching, every folder is open so matches inside collapsed ones show
835
+ expanded: b ? !0 : te,
835
836
  rowSelection: y,
836
837
  globalFilter: b,
837
838
  rowPinning: G
@@ -2,26 +2,25 @@ import { jsx as E, jsxs as G, Fragment as $e } from "react/jsx-runtime";
2
2
  import { useState as U, useCallback as O, useMemo as P, useContext as Ct, useEffect as ue, forwardRef as Lt, useRef as we, useId as wt, useImperativeHandle as Et, useLayoutEffect as _e } from "react";
3
3
  import { Splitter as Dt, SplitterPanel as kt } from "primereact/splitter";
4
4
  import B from "styled-components";
5
- import { i as Rt, P as At, e as ze, U as it } from "./MetaWidget.es.js";
5
+ import { i as Rt, P as At, d as ze, U as it } from "./MetaWidget.es.js";
6
6
  import "@module-federation/enhanced/runtime";
7
7
  import { menuItemsAt as Mt } from "@ynput/ayon-addon/host";
8
8
  import { toast as Qe } from "react-toastify";
9
9
  import { InputText as _t, Button as Pt, Icon as Ot } from "@ynput/ayon-react-components";
10
- import { bt as Je, bD as Nt, bB as rt, bA as Ft, bG as jt } from "./searchTerms.es.js";
11
- import { dw as lt, cO as $t, bZ as zt, bD as Ut } from "./getUris.es.js";
10
+ import { bs as Je, bD as Nt, bB as rt, bA as Ft, bG as jt } from "./searchTerms.es.js";
11
+ import { dx as lt, cP as $t, b_ as zt, bE as Ut } from "./getUris.es.js";
12
12
  import "primereact/confirmdialog";
13
- import { p as ct, z as Ue, y as be, d as Bt, b as Be, x as Vt, ac as Ht, ab as Gt, u as dt, ak as Wt } from "./TableExportContextInstance.es.js";
14
13
  import "lodash";
15
14
  import "uuid";
16
15
  import "axios";
16
+ import { l as ct, s as Ue, q as be, c as Bt, b as Be, m as Vt, ae as Ht, ad as Gt, u as dt, al as Wt, _ as Xe } from "./TableExportContextInstance.es.js";
17
17
  import "semver";
18
18
  import "./ContextMenuContextInstance.es.js";
19
19
  import Y from "clsx";
20
20
  import "react-dom";
21
- import "react-redux";
22
21
  import "react-router-dom";
23
- import { E as Kt, u as qt } from "./EntityPickerDialog.es.js";
24
- import "./PlayableIcon.es.js";
22
+ import { E as qt, u as Kt } from "./EntityPickerDialog.es.js";
23
+ import "./FilmstripEntityCard.es.js";
25
24
  import "date-fns";
26
25
  import "lexical";
27
26
  import "@lexical/markdown";
@@ -35,9 +34,10 @@ import "@lexical/react/LexicalBlockWithAlignableContents";
35
34
  import "@lexical/react/LexicalDecoratorBlockNode";
36
35
  import { useContributions as Yt, prefetchPiece as Qt, runContribution as Jt } from "@ynput/ayon-addon";
37
36
  import "@tanstack/react-table";
37
+ import "react-redux";
38
38
  import { b as ge, H as Xt, a as Zt, e as en, S as tn } from "./SimpleTable.es.js";
39
39
  import { D as nn, L as sn, s as on } from "./sortLists.es.js";
40
- import { a as Xe, g as Pe } from "./getEntityTypeIcon.es.js";
40
+ import { a as Ze, g as Pe } from "./getEntityTypeIcon.es.js";
41
41
  import { g as an } from "./iconUtils.es.js";
42
42
  import { u as rn, a as ln } from "./useAttributeEnums.es.js";
43
43
  import { b as cn, s as dn } from "./buildHierarchicalTableRows.es.js";
@@ -45,7 +45,6 @@ import { n as Ce } from "./entityDefinitions.es.js";
45
45
  import { a as un, K as pn } from "./platform.es.js";
46
46
  import { u as mn } from "./NewEntityContextInstance.es.js";
47
47
  import { u as fn } from "./VersionUploadContextInstance.es.js";
48
- import { F as Ze } from "./EntityUpdatesContext.es.js";
49
48
  import { M as hn, a as gn } from "./Menu.es.js";
50
49
  const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) => ({
51
50
  id: ut,
@@ -55,7 +54,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
55
54
  if (e === "entityList") return nn;
56
55
  const [t] = Ve(e);
57
56
  return { by: t.id, desc: t.desc };
58
- }, to = (e, t) => {
57
+ }, eo = (e, t) => {
59
58
  const { by: s, desc: a } = t || {};
60
59
  return Ve(e).some((u) => u.id === s) ? { by: s, desc: !!a } : pt(e);
61
60
  }, Sn = ["noValue", "hasValue"], Tn = (e) => e.id.startsWith("folder-"), vn = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), Ne = (e) => e.label || e.name || "", mt = (e, t, { by: s, desc: a }) => {
@@ -155,7 +154,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
155
154
  }, kn = "slicer-splitter", et = {
156
155
  minSize: 2,
157
156
  size: 12
158
- }, no = () => {
157
+ }, to = () => {
159
158
  const [e, t] = ct(kn, [
160
159
  et.size,
161
160
  100 - et.size
@@ -331,7 +330,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
331
330
  onMoveComplete: a
332
331
  });
333
332
  return t?.entities.length ? /* @__PURE__ */ E(
334
- Kt,
333
+ qt,
335
334
  {
336
335
  projectName: e,
337
336
  entityType: "folder",
@@ -429,7 +428,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
429
428
  name: n.label,
430
429
  label: n.label,
431
430
  ...T.length > 0 && { parents: T },
432
- icon: Xe(n),
431
+ icon: Ze(n),
433
432
  subRows: [],
434
433
  data: {
435
434
  id: n.id,
@@ -485,7 +484,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
485
484
  id: f.id,
486
485
  name: f.label,
487
486
  label: f.label,
488
- icon: Xe(f),
487
+ icon: Ze(f),
489
488
  subRows: [],
490
489
  data: {
491
490
  id: f.id,
@@ -615,7 +614,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
615
614
  data: X,
616
615
  getData: ae,
617
616
  isFetching: L
618
- } = qt({
617
+ } = Kt({
619
618
  projectName: i || "",
620
619
  folderTypes: me?.folderTypes || [],
621
620
  includeColors: !0
@@ -677,12 +676,12 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
677
676
  isExpandable: !1,
678
677
  isAttribute: !0
679
678
  };
680
- const ie = { data: [], isExpandable: !1 }, [V, _] = U(ie), K = Z[h], re = r.find(
679
+ const ie = { data: [], isExpandable: !1 }, [V, _] = U(ie), q = Z[h], re = r.find(
681
680
  (w) => Z[w.value] && !t.includes(w.value)
682
681
  )?.value;
683
682
  ue(() => {
684
- ne || K || !re || b(re, !1);
685
- }, [ne, K, re]);
683
+ ne || q || !re || b(re, !1);
684
+ }, [ne, q, re]);
686
685
  const De = (w, R) => {
687
686
  const F = Z[w];
688
687
  if (!F) {
@@ -695,16 +694,16 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
695
694
  if (ne) return;
696
695
  (async () => {
697
696
  try {
698
- if (!K) return;
697
+ if (!q) return;
699
698
  D(!0);
700
- const R = await K.getData();
699
+ const R = await q.getData();
701
700
  if (R === void 0)
702
701
  throw window.alert(
703
702
  "Slice options failed to load. This likely means the PowerFeatures addon is out of date. Please update to the latest version."
704
703
  ), b(re ?? "hierarchy", !1), new Error("Slice data is undefined");
705
- K.hasValue && R.unshift(Un(h)), K.noValue && R.unshift(zn(h)), _({
704
+ q.hasValue && R.unshift(Un(h)), q.noValue && R.unshift(zn(h)), _({
706
705
  data: R,
707
- isExpandable: K.isExpandable
706
+ isExpandable: q.isExpandable
708
707
  });
709
708
  } catch (R) {
710
709
  console.error("Error fetching slice data:", R), _(ie);
@@ -713,9 +712,9 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
713
712
  }
714
713
  })();
715
714
  }, [h, i, ne, h === "hierarchy" ? X : null]);
716
- const q = l?.by, Te = !!l?.desc, N = P(
717
- () => q ? In(V.data, h, { by: q, desc: Te }) : V.data,
718
- [V.data, h, q, Te]
715
+ const K = l?.by, Te = !!l?.desc, N = P(
716
+ () => K ? In(V.data, h, { by: K, desc: Te }) : V.data,
717
+ [V.data, h, K, Te]
719
718
  ), j = P(
720
719
  () => gt(N, a, u, c),
721
720
  [N, a, u, c]
@@ -767,7 +766,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
767
766
  min-width: 0;
768
767
  height: 28px;
769
768
  min-height: 28px;
770
- `, Kn = ({ open: e, value: t, subject: s, onChange: a }) => {
769
+ `, qn = ({ open: e, value: t, subject: s, onChange: a }) => {
771
770
  const u = () => a(e ? void 0 : ""), c = (g) => {
772
771
  g.key === "Escape" && a(void 0);
773
772
  }, p = (g) => {
@@ -801,7 +800,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
801
800
  ] });
802
801
  }, je = (e, t) => {
803
802
  e.toggleExpanded(t), e.subRows?.forEach((s) => je(s, t));
804
- }, nt = (e) => e.map((t) => t.id).filter(Boolean), qn = (e, t, s, a) => {
803
+ }, nt = (e) => e.map((t) => t.id).filter(Boolean), Kn = (e, t, s, a) => {
805
804
  const { onOpenNew: u } = mn(), { projectName: c } = be(), { setEntities: p } = Vt(), g = fn(), [l] = lt(), { deleteEntities: m } = Ht(), [y, C] = U(null), f = O(
806
805
  (r, d) => d.map((o) => t?.get(o) || (o === r.id ? r : void 0)).filter((o) => !!o),
807
806
  [t]
@@ -1082,14 +1081,14 @@ const Qn = (e, t, s) => {
1082
1081
  className: Y(c.className, {
1083
1082
  syncing: g,
1084
1083
  "has-updates": r,
1085
- "auto-sync": o && !Ze
1084
+ "auto-sync": o && !Xe
1086
1085
  }),
1087
1086
  "data-shortcut": "Shift+R",
1088
1087
  "data-tooltip": r ? d : "Refresh data",
1089
1088
  variant: r ? "filled" : "surface"
1090
1089
  }
1091
1090
  ),
1092
- !Ze
1091
+ !Xe
1093
1092
  ] });
1094
1093
  }
1095
1094
  ), st = B.div`
@@ -1270,9 +1269,9 @@ const Qn = (e, t, s) => {
1270
1269
  ), {
1271
1270
  sliceOptions: V,
1272
1271
  sliceType: _,
1273
- handleSliceTypeChange: K,
1272
+ handleSliceTypeChange: q,
1274
1273
  table: { data: re, isExpandable: De },
1275
- sliceMap: q,
1274
+ sliceMap: K,
1276
1275
  isLoading: Te
1277
1276
  } = Bn({
1278
1277
  sliceFields: s,
@@ -1284,9 +1283,9 @@ const Qn = (e, t, s) => {
1284
1283
  sliceType: e.sliceType,
1285
1284
  onSliceTypeChange: Z,
1286
1285
  sort: se(e.sliceType)
1287
- }), N = _ === "hierarchy", j = !!m && I.includes(e.id), w = V.find((S) => S.value === _)?.label || _, R = C !== void 0, F = C ?? "", le = N ? "Folders" : w, H = qn(
1286
+ }), N = _ === "hierarchy", j = !!m && I.includes(e.id), w = V.find((S) => S.value === _)?.label || _, R = C !== void 0, F = C ?? "", le = N ? "Folders" : w, H = Kn(
1288
1287
  p || pe,
1289
- q,
1288
+ K,
1290
1289
  Q,
1291
1290
  g
1292
1291
  ), { contributions: Ge } = Yt("slicer.menuItem"), ke = P(
@@ -1297,7 +1296,7 @@ const Qn = (e, t, s) => {
1297
1296
  ), Re = (S, M, ce = "bottom") => {
1298
1297
  if (!M.length) return [];
1299
1298
  const $ = _ === "hierarchy", Ie = M.map((z) => {
1300
- const de = q.get(z), xe = de?.data?.entityType;
1299
+ const de = K.get(z), xe = de?.data?.entityType;
1301
1300
  return {
1302
1301
  id: z,
1303
1302
  name: de?.name,
@@ -1310,7 +1309,7 @@ const Qn = (e, t, s) => {
1310
1309
  entityType: xe,
1311
1310
  projectName: ee,
1312
1311
  name: de,
1313
- label: q.get(z)?.label || void 0
1312
+ label: K.get(z)?.label || void 0
1314
1313
  })) : [], xt = { projectName: ee, sliceType: _, selected: Ie, entities: It, menu: S };
1315
1314
  return Mt(ke, ce).filter((z) => !z.in?.length || z.in.includes(S)).map((z) => ({
1316
1315
  id: z.key,
@@ -1327,18 +1326,18 @@ const Qn = (e, t, s) => {
1327
1326
  ...N ? H.rowContextMenuBuilders : [],
1328
1327
  We("bottom"),
1329
1328
  ...N ? [H.deleteContextMenuBuilder] : []
1330
- ] : N ? [...H.rowContextMenuBuilders, H.deleteContextMenuBuilder] : [], Ke = P(
1329
+ ] : N ? [...H.rowContextMenuBuilders, H.deleteContextMenuBuilder] : [], qe = P(
1331
1330
  () => V.map((S) => S.value).filter((S) => !t.some((M) => M.sliceType === S)),
1332
1331
  [V, t]
1333
- ), ve = !!l && Ke.length > 0, Ae = P(() => {
1332
+ ), ve = !!l && qe.length > 0, Ae = P(() => {
1334
1333
  const S = V.map(
1335
1334
  (M) => ie.includes(M.value) ? { ...M, disabled: !0, disabledMessage: "Already used by another panel" } : M
1336
1335
  );
1337
1336
  return ve && S.push({ label: "Split slicer", value: ot, icon: "splitscreen_add" }), S;
1338
1337
  }, [V, ie, ve]), Me = () => {
1339
1338
  if (!J) return W("slicer");
1340
- b(Ke[0]);
1341
- }, { menuOpen: bt, toggleMenuOpen: qe } = dt(), he = `slicer-menu-${me}-${e.id}`.replace(/[^\w-]/g, "-"), St = bt === he, Ye = Object.keys(X).filter((S) => X[S]), Tt = [
1339
+ b(qe[0]);
1340
+ }, { menuOpen: bt, toggleMenuOpen: Ke } = dt(), he = `slicer-menu-${me}-${e.id}`.replace(/[^\w-]/g, "-"), St = bt === he, Ye = Object.keys(X).filter((S) => X[S]), Tt = [
1342
1341
  ...Re("dropdown", Ye, "top"),
1343
1342
  {
1344
1343
  id: "search",
@@ -1376,7 +1375,7 @@ const Qn = (e, t, s) => {
1376
1375
  Me();
1377
1376
  return;
1378
1377
  }
1379
- K(M, !!y && u === _);
1378
+ q(M, !!y && u === _);
1380
1379
  };
1381
1380
  return /* @__PURE__ */ G(Zt, { children: [
1382
1381
  /* @__PURE__ */ G(
@@ -1410,7 +1409,7 @@ const Qn = (e, t, s) => {
1410
1409
  disableOpen: Ae.length === 1
1411
1410
  }
1412
1411
  ),
1413
- j && /* @__PURE__ */ E(es, { rowSelection: X, sliceMap: q }),
1412
+ j && /* @__PURE__ */ E(es, { rowSelection: X, sliceMap: K }),
1414
1413
  /* @__PURE__ */ G(
1415
1414
  ns,
1416
1415
  {
@@ -1426,13 +1425,13 @@ const Qn = (e, t, s) => {
1426
1425
  className: Y("slicer-menu", { active: St }),
1427
1426
  "data-tooltip": "More",
1428
1427
  "data-tooltip-delay": 0,
1429
- onClick: () => qe(he)
1428
+ onClick: () => Ke(he)
1430
1429
  }
1431
1430
  ),
1432
- /* @__PURE__ */ E(hn, { targetId: he, id: he, align: "left", children: /* @__PURE__ */ E(gn, { menu: Tt, onClose: () => qe(!1) }) })
1431
+ /* @__PURE__ */ E(hn, { targetId: he, id: he, align: "left", children: /* @__PURE__ */ E(gn, { menu: Tt, onClose: () => Ke(!1) }) })
1433
1432
  ] }),
1434
1433
  !j && /* @__PURE__ */ E(
1435
- Kn,
1434
+ qn,
1436
1435
  {
1437
1436
  open: R,
1438
1437
  value: F,
@@ -1482,7 +1481,7 @@ const Qn = (e, t, s) => {
1482
1481
  onRowSelectionChange: L,
1483
1482
  expanded: ae,
1484
1483
  setExpanded: A,
1485
- data: q,
1484
+ data: K,
1486
1485
  children: /* @__PURE__ */ E(
1487
1486
  tn,
1488
1487
  {
@@ -1519,7 +1518,7 @@ const Qn = (e, t, s) => {
1519
1518
  }
1520
1519
  `
1521
1520
  ).join("")}
1522
- `, so = ({
1521
+ `, no = ({
1523
1522
  sliceFields: e = [],
1524
1523
  entityTypes: t = ["task"],
1525
1524
  pinnedSliceType: s,
@@ -1638,20 +1637,20 @@ export {
1638
1637
  et as b,
1639
1638
  kn as c,
1640
1639
  ut as d,
1641
- so as e,
1640
+ no as e,
1642
1641
  Fn as f,
1643
1642
  Dn as g,
1644
1643
  tt as h,
1645
1644
  pt as i,
1646
1645
  Ve as j,
1647
1646
  En as k,
1648
- qn as l,
1647
+ Kn as l,
1649
1648
  Hn as m,
1650
1649
  Rn as n,
1651
- no as o,
1650
+ to as o,
1652
1651
  Xn as p,
1653
1652
  xn as q,
1654
- to as r,
1653
+ eo as r,
1655
1654
  In as s,
1656
1655
  jn as u
1657
1656
  };