@ynput/ayon-frontend-shared 0.7.2 → 0.7.4

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/LICENSE +105 -0
  2. package/dist/DetailsPanel.es.js +1088 -969
  3. package/dist/ListTable.es.js +70 -67
  4. package/dist/NewEntity.es.js +8 -5
  5. package/dist/ProjectTreeTable.es.js +4134 -3825
  6. package/dist/ProjectsTable.es.js +526 -0
  7. package/dist/Slicer.es.js +75 -73
  8. package/dist/Views.es.js +86 -84
  9. package/dist/chunks/Actions.es.js +4 -2
  10. package/dist/chunks/ColumnDropIndicator.es.js +21 -18
  11. package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
  14. package/dist/chunks/EmptyPlaceholder.es.js +9 -8
  15. package/dist/chunks/EntityPath.es.js +15 -14
  16. package/dist/chunks/EntityPickerDialog.es.js +5 -3
  17. package/dist/chunks/EntityTooltip.es.js +10 -8
  18. package/dist/chunks/EntityUpdatesContext.es.js +13 -12
  19. package/dist/chunks/Feed.es.js +12 -11
  20. package/dist/chunks/FilterErrorActions.es.js +6 -4
  21. package/dist/chunks/GroupSettingsFallback.es.js +75 -0
  22. package/dist/chunks/JsonViewer.es.js +3 -2
  23. package/dist/chunks/Menu.es.js +105 -103
  24. package/dist/chunks/MetaWidget.es.js +278 -275
  25. package/dist/chunks/PlayableIcon.es.js +868 -862
  26. package/dist/chunks/ProjectContext.es.js +5 -4
  27. package/dist/chunks/RepresentationsList.es.js +3 -2
  28. package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
  29. package/dist/chunks/SimpleTable.es.js +492 -402
  30. package/dist/chunks/Slicer.es.js +936 -896
  31. package/dist/chunks/TableExportContextInstance.es.js +437 -339
  32. package/dist/chunks/TableSettingsFallback.es.js +5 -3
  33. package/dist/chunks/ThumbnailSimple.es.js +15 -13
  34. package/dist/chunks/VideoPlayer.es.js +14 -12
  35. package/dist/chunks/Watchers.es.js +97 -95
  36. package/dist/chunks/getProjectDisplayName.es.js +4 -0
  37. package/dist/chunks/getUris.es.js +375 -374
  38. package/dist/chunks/useHierarchySelection.es.js +5 -3
  39. package/dist/chunks/useLoadModule.es.js +10 -8
  40. package/dist/chunks/viewUpdateHelper.es.js +12 -10
  41. package/dist/components.es.js +1488 -1186
  42. package/dist/context.es.js +589 -539
  43. package/dist/hooks.es.js +169 -212
  44. package/dist/index.es.js +17 -12
  45. package/dist/types/Actions.d.ts +17 -14
  46. package/dist/types/ContextMenu.d.ts +17 -14
  47. package/dist/types/DetailsPanel.d.ts +17 -14
  48. package/dist/types/EntityPickerDialog.d.ts +17 -14
  49. package/dist/types/Feed.d.ts +17 -14
  50. package/dist/types/ListTable.d.ts +17 -14
  51. package/dist/types/NewEntity.d.ts +17 -14
  52. package/dist/types/ProjectTreeTable.d.ts +749 -15
  53. package/dist/types/ProjectsTable.d.ts +228 -0
  54. package/dist/types/RepresentationsList.d.ts +17 -14
  55. package/dist/types/SimpleTable.d.ts +31 -14
  56. package/dist/types/Slicer.d.ts +18 -14
  57. package/dist/types/Views.d.ts +17 -14
  58. package/dist/types/api.d.ts +17 -14
  59. package/dist/types/components.d.ts +822 -25
  60. package/dist/types/context.d.ts +53 -15
  61. package/dist/types/hooks.d.ts +17 -14
  62. package/dist/types/index.d.ts +17 -14
  63. package/dist/types/util.d.ts +21 -14
  64. package/dist/util.es.js +152 -144
  65. package/package.json +16 -9
  66. /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
package/dist/Slicer.es.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { r as pe } from "./chunks/Slicer.es.js";
2
- import { S as nt, a as ot, b as rt, c as it, d as ct, e as lt, f as dt, g as at, h as ut, i as ft, j as St, k as yt, s as ht, u as pt, l as Et, m as It, n as gt, o as mt } from "./chunks/Slicer.es.js";
2
+ import { S as rt, a as it, b as ct, c as lt, d as dt, e as at, f as ut, g as ft, h as St, i as yt, j as ht, k as pt, s as Et, u as It, l as mt, m as gt, n as wt, o as Pt } from "./chunks/Slicer.es.js";
3
3
  import { jsx as Ee } from "react/jsx-runtime";
4
4
  import { useState as O, useEffect as A, useRef as q, useCallback as I, useMemo as L } from "react";
5
- import { a as X, r as z, w as ae, p as Ie } from "./chunks/TableExportContextInstance.es.js";
6
- import { S as ge, c as me, d as we } from "./chunks/MetaWidget.es.js";
7
- import { e as Pt, u as xt } from "./chunks/MetaWidget.es.js";
5
+ import { b as X, p as z, s as ae, o as Ie } from "./chunks/TableExportContextInstance.es.js";
6
+ import { S as me, d as ge, e as we } from "./chunks/MetaWidget.es.js";
7
+ import { f as vt, u as kt } from "./chunks/MetaWidget.es.js";
8
8
  import "@module-federation/enhanced/runtime";
9
+ import "@ynput/ayon-addon/host";
9
10
  import "react-toastify";
10
11
  import "@ynput/ayon-react-components";
11
12
  import { aI as U, az as Pe } from "./chunks/searchTerms.es.js";
@@ -13,6 +14,7 @@ import "./chunks/getUris.es.js";
13
14
  import "primereact/confirmdialog";
14
15
  import "lodash";
15
16
  import "uuid";
17
+ import "axios";
16
18
  import { u as ue } from "./chunks/useLoadModule.es.js";
17
19
  import "./chunks/ContextMenuContextInstance.es.js";
18
20
  import "clsx";
@@ -20,7 +22,7 @@ import "react-dom";
20
22
  import { useDispatch as xe } from "react-redux";
21
23
  import "react-router-dom";
22
24
  import "semver";
23
- import { u as kt } from "./chunks/useHierarchySelection.es.js";
25
+ import { u as Rt } from "./chunks/useHierarchySelection.es.js";
24
26
  const ve = () => {
25
27
  const o = () => ({
26
28
  formatStatuses: () => [],
@@ -41,7 +43,7 @@ const ve = () => {
41
43
  addon: "powerpack",
42
44
  remote: "slicer",
43
45
  module: "SlicerDropdown",
44
- fallback: ge,
46
+ fallback: me,
45
47
  skip: !e
46
48
  // skip loading if powerpack license is not available
47
49
  });
@@ -60,15 +62,15 @@ const ve = () => {
60
62
  A(() => {
61
63
  const t = (u) => {
62
64
  const f = u.detail?.key ?? ("key" in u ? u.key : void 0);
63
- f && !ke.some((m) => f.startsWith(m)) || d((m) => m + 1);
65
+ f && !ke.some((g) => f.startsWith(g)) || d((g) => g + 1);
64
66
  };
65
67
  return window.addEventListener("session-storage", t), window.addEventListener("storage", t), () => {
66
68
  window.removeEventListener("session-storage", t), window.removeEventListener("storage", t);
67
69
  };
68
70
  }, []);
69
71
  const S = q(/* @__PURE__ */ new Map()), a = I((t, u) => {
70
- const f = typeof window > "u" ? null : sessionStorage.getItem(t), m = S.current.get(t);
71
- if (m && m.raw === f) return m.value;
72
+ const f = typeof window > "u" ? null : sessionStorage.getItem(t), g = S.current.get(t);
73
+ if (g && g.raw === f) return g.value;
72
74
  const _ = z(t, u);
73
75
  return S.current.set(t, { raw: f, value: _ }), _;
74
76
  }, []), r = o[0], y = I(
@@ -81,8 +83,8 @@ const ve = () => {
81
83
  c.setRowSelection(u);
82
84
  return;
83
85
  }
84
- const f = fe(s, e, t), m = typeof u == "function" ? u(a(f, {})) : u;
85
- ae(f, m);
86
+ const f = fe(s, e, t), g = typeof u == "function" ? u(a(f, {})) : u;
87
+ ae(f, g);
86
88
  },
87
89
  [c.setRowSelection, r, s, e, a]
88
90
  ), w = I(
@@ -94,11 +96,11 @@ const ve = () => {
94
96
  c.setExpanded(u);
95
97
  return;
96
98
  }
97
- const f = Se(s, e, t), m = typeof u == "function" ? u(a(f, {})) : u;
98
- ae(f, m);
99
+ const f = Se(s, e, t), g = typeof u == "function" ? u(a(f, {})) : u;
100
+ ae(f, g);
99
101
  },
100
102
  [c.setExpanded, r, s, e, a]
101
- ), P = y(r), g = I(
103
+ ), P = y(r), m = I(
102
104
  (t, u = r) => p(u, t),
103
105
  [p, r]
104
106
  ), T = w(r), x = I(
@@ -107,7 +109,7 @@ const ve = () => {
107
109
  );
108
110
  return {
109
111
  rowSelection: P,
110
- setRowSelection: g,
112
+ setRowSelection: m,
111
113
  expanded: T,
112
114
  setExpanded: x,
113
115
  getPanelSelection: y,
@@ -115,7 +117,7 @@ const ve = () => {
115
117
  getPanelExpanded: w,
116
118
  setPanelExpanded: i
117
119
  };
118
- }, ye = ["overview", "products"], je = ({
120
+ }, ye = ["overview", "products"], Ne = ({
119
121
  children: o,
120
122
  page: e,
121
123
  projectName: s,
@@ -129,17 +131,17 @@ const ve = () => {
129
131
  const [y, p] = Ie(
130
132
  `slicer-pinned-slice-${e}`,
131
133
  null
132
- ), { powerLicense: w } = X(), i = c, P = i?.sliceTypes, g = i?.sliceType, T = P?.length ? g && g !== P[0] ? [g, ...P.slice(1)] : P : [g ?? "hierarchy"], x = ye.includes(e) && !r.sliceType && !P?.length && T[0] !== "hierarchy" && y?.sliceType === "hierarchy" && Object.values(y.rowSelection || {}).some(Boolean), t = L(
134
+ ), { powerLicense: w } = X(), i = c, P = i?.sliceTypes, m = i?.sliceType, T = P?.length ? m && m !== P[0] ? [m, ...P.slice(1)] : P : [m ?? "hierarchy"], x = ye.includes(e) && !r.sliceType && !P?.length && T[0] !== "hierarchy" && y?.sliceType === "hierarchy" && Object.values(y.rowSelection || {}).some(Boolean), t = L(
133
135
  () => [
134
136
  ...new Set(
135
137
  r.sliceType ? [r.sliceType] : x ? [...T, "hierarchy"] : T
136
138
  )
137
139
  ],
138
140
  [r.sliceType, T.join("|"), x]
139
- ), u = i?.collapsedSliceTypes, f = L(() => u ?? [], [u?.join("|")]), m = L(
141
+ ), u = i?.collapsedSliceTypes, f = L(() => u ?? [], [u?.join("|")]), g = L(
140
142
  () => t.map((n) => ({ id: n, sliceType: n })),
141
143
  [t]
142
- ), _ = m[0].sliceType, {
144
+ ), _ = g[0].sliceType, {
143
145
  rowSelection: D,
144
146
  setRowSelection: M,
145
147
  expanded: G,
@@ -147,7 +149,7 @@ const ve = () => {
147
149
  getPanelSelection: B,
148
150
  setPanelSelection: C,
149
151
  getPanelExpanded: J,
150
- setPanelExpanded: F
152
+ setPanelExpanded: b
151
153
  } = Te({
152
154
  sliceTypes: t,
153
155
  page: e,
@@ -190,15 +192,15 @@ const ve = () => {
190
192
  v(t, E);
191
193
  },
192
194
  [f, v, t]
193
- ), b = `${s}-${e}`, N = q(/* @__PURE__ */ new Set());
195
+ ), F = `${s}-${e}`, N = q(/* @__PURE__ */ new Set());
194
196
  A(() => {
195
- !x || l || N.current.has(b) || (N.current.add(b), Object.keys(B("hierarchy")).length || (C("hierarchy", y.rowSelection), F("hierarchy", y.expanded)), v(t));
196
- }, [x, l, b]);
197
+ !x || l || N.current.has(F) || (N.current.add(F), Object.keys(B("hierarchy")).length || (C("hierarchy", y.rowSelection), b("hierarchy", y.expanded)), v(t));
198
+ }, [x, l, F]);
197
199
  const ee = q(/* @__PURE__ */ new Set());
198
200
  A(() => {
199
- if (ee.current.has(b) || l || r.sliceType || r.rowSelection || r.setRowSelection || P?.length)
201
+ if (ee.current.has(F) || l || r.sliceType || r.rowSelection || r.setRowSelection || P?.length)
200
202
  return;
201
- ee.current.add(b);
203
+ ee.current.add(F);
202
204
  const n = `slicer-selection-${s}-${e}`, E = `slicer-expanded-${s}-${e}`, h = T[0];
203
205
  if (h !== "hierarchy") {
204
206
  const R = z(n, null);
@@ -208,11 +210,11 @@ const ve = () => {
208
210
  (de) => Object.keys(de).length ? de : R
209
211
  );
210
212
  const k = z(E, null);
211
- k && F(h, k);
213
+ k && b(h, k);
212
214
  }
213
215
  }
214
216
  sessionStorage.removeItem(n), sessionStorage.removeItem(E);
215
- }, [l, P, b]), A(() => {
217
+ }, [l, P, F]), A(() => {
216
218
  ye.includes(e) && !r.sliceType && !l && y && !x && p(null);
217
219
  }, [e, r.sliceType, l, y, x, p]);
218
220
  const te = I(
@@ -241,9 +243,9 @@ const ve = () => {
241
243
  ]
242
244
  ), W = I(
243
245
  (n) => {
244
- n !== "hierarchy" && (C(n, {}), F(n, {}));
246
+ n !== "hierarchy" && (C(n, {}), b(n, {}));
245
247
  },
246
- [C, F]
248
+ [C, b]
247
249
  ), se = I(
248
250
  (n) => {
249
251
  !n || t.includes(n) || (v([...t, n]), W(n));
@@ -280,14 +282,14 @@ const ve = () => {
280
282
  sliceType: _,
281
283
  onSliceTypeChange: te,
282
284
  // SLICE PANELS
283
- slices: m,
285
+ slices: g,
284
286
  addSlicePanel: se,
285
287
  removeSlicePanel: ne,
286
288
  setPanelSliceType: oe,
287
289
  getPanelSelection: B,
288
290
  setPanelSelection: C,
289
291
  getPanelExpanded: J,
290
- setPanelExpanded: F,
292
+ setPanelExpanded: b,
291
293
  collapsedPanels: f,
292
294
  togglePanelCollapsed: V,
293
295
  getSliceSort: Z,
@@ -312,7 +314,7 @@ const ve = () => {
312
314
  le,
313
315
  _,
314
316
  te,
315
- m,
317
+ g,
316
318
  f,
317
319
  V,
318
320
  Z,
@@ -323,7 +325,7 @@ const ve = () => {
323
325
  B,
324
326
  C,
325
327
  J,
326
- F,
328
+ b,
327
329
  D,
328
330
  Q,
329
331
  y,
@@ -335,8 +337,8 @@ const ve = () => {
335
337
  a
336
338
  ]
337
339
  );
338
- return /* @__PURE__ */ Ee(me.Provider, { value: he, children: o });
339
- }, Ve = ({
340
+ return /* @__PURE__ */ Ee(ge.Provider, { value: he, children: o });
341
+ }, et = ({
340
342
  sliceFilter: o,
341
343
  persistedHierarchySelection: e,
342
344
  filters: s,
@@ -424,12 +426,12 @@ const ve = () => {
424
426
  versionIds: [...e.version],
425
427
  productIds: [...e.product]
426
428
  };
427
- }, Ne = ({
429
+ }, tt = ({
428
430
  slices: o,
429
431
  projectName: e
430
432
  }) => {
431
- const s = xe(), [c, l] = O($), [d, S] = O($), [a, r] = O(Y), [y, p] = O(""), w = o.find((g) => g.sliceType === "entityList")?.rowSelection, i = L(
432
- () => Object.keys(w ?? {}).filter((g) => w?.[g] && !g.startsWith("folder-")).sort(),
433
+ const s = xe(), [c, l] = O($), [d, S] = O($), [a, r] = O(Y), [y, p] = O(""), w = o.find((m) => m.sliceType === "entityList")?.rowSelection, i = L(
434
+ () => Object.keys(w ?? {}).filter((m) => w?.[m] && !m.startsWith("folder-")).sort(),
433
435
  [w]
434
436
  ), P = i.length && e ? `${e}|${i}` : "";
435
437
  return A(() => {
@@ -437,30 +439,30 @@ const ve = () => {
437
439
  l($), S($), r(Y), p("");
438
440
  return;
439
441
  }
440
- let g = !1;
442
+ let m = !1;
441
443
  return (async () => {
442
444
  try {
443
445
  const x = await Promise.all(
444
446
  i.map(
445
- (m) => s(
446
- Pe.endpoints.getListEntities.initiate({ projectName: e, listId: m })
447
+ (g) => s(
448
+ Pe.endpoints.getListEntities.initiate({ projectName: e, listId: g })
447
449
  ).unwrap()
448
450
  )
449
451
  ), t = Le(x);
450
- g || S(t);
452
+ m || S(t);
451
453
  const { parentMaps: u, ...f } = await Re(
452
454
  t,
453
455
  e,
454
456
  s
455
457
  );
456
- g || (l(f), r(u));
458
+ m || (l(f), r(u));
457
459
  } catch (x) {
458
- console.error("Error fetching entity list IDs:", x), g || (l($), S($), r(Y));
460
+ console.error("Error fetching entity list IDs:", x), m || (l($), S($), r(Y));
459
461
  } finally {
460
- g || p(P);
462
+ m || p(P);
461
463
  }
462
464
  })(), () => {
463
- g = !0;
465
+ m = !0;
464
466
  };
465
467
  }, [P, i, e, s]), { entityIds: c, rawEntityIds: d, parentMaps: a, isLoading: P !== y };
466
468
  }, _e = ({ slice: o, attribFields: e }) => {
@@ -492,7 +494,7 @@ const ve = () => {
492
494
  }, Ce = ({
493
495
  slices: o,
494
496
  attribFields: e
495
- }) => o.filter((s) => s.sliceType !== "hierarchy" && s.sliceType !== "entityList").map((s) => _e({ slice: s, attribFields: e })).filter((s) => !!s), et = (o) => {
497
+ }) => o.filter((s) => s.sliceType !== "hierarchy" && s.sliceType !== "entityList").map((s) => _e({ slice: s, attribFields: e })).filter((s) => !!s), st = (o) => {
496
498
  const { slices: e, getPanelSelection: s } = we(), { powerLicense: c, isLoading: l } = X(), d = L(() => {
497
499
  const a = e.map((r) => ({
498
500
  sliceType: r.sliceType,
@@ -510,36 +512,36 @@ const ve = () => {
510
512
  };
511
513
  };
512
514
  export {
513
- nt as SLICER_DEFAULT_PANEL_HEIGHT,
514
- ot as SLICER_MIN_PANEL_HEIGHT,
515
- Pt as SLICER_PAGES_CONFIG,
516
- rt as SLICER_SPLITTER_PANEL_CONFIG,
517
- it as SLICER_SPLITTER_STATE_KEY,
518
- ct as SLICE_DEFAULT_ORDER,
519
- lt as Slicer,
520
- me as SlicerContext,
521
- je as SlicerProvider,
522
- dt as buildListFolderRowId,
523
- at as clampDraggedHeights,
515
+ rt as SLICER_DEFAULT_PANEL_HEIGHT,
516
+ it as SLICER_MIN_PANEL_HEIGHT,
517
+ vt as SLICER_PAGES_CONFIG,
518
+ ct as SLICER_SPLITTER_PANEL_CONFIG,
519
+ lt as SLICER_SPLITTER_STATE_KEY,
520
+ dt as SLICE_DEFAULT_ORDER,
521
+ at as Slicer,
522
+ ge as SlicerContext,
523
+ Ne as SlicerProvider,
524
+ ut as buildListFolderRowId,
525
+ ft as clampDraggedHeights,
524
526
  _e as createFilterFromSlicer,
525
527
  Ce as createFiltersFromSlicer,
526
- ut as defaultSliceOptions,
527
- ft as getDefaultSliceSort,
528
- St as getSliceSortOptions,
529
- yt as resolvePanelLayout,
528
+ St as defaultSliceOptions,
529
+ yt as getDefaultSliceSort,
530
+ ht as getSliceSortOptions,
531
+ pt as resolvePanelLayout,
530
532
  pe as resolveSliceSort,
531
- ht as sortSliceRows,
532
- pt as useEntityListsSlice,
533
- Ve as useFiltersWithHierarchy,
534
- Et as useHierarchyContextMenuItems,
535
- kt as useHierarchySelection,
536
- xt as useOptionalSlicerContext,
537
- Ne as useSelectedEntityIds,
533
+ Et as sortSliceRows,
534
+ It as useEntityListsSlice,
535
+ et as useFiltersWithHierarchy,
536
+ mt as useHierarchyContextMenuItems,
537
+ Rt as useHierarchySelection,
538
+ kt as useOptionalSlicerContext,
539
+ tt as useSelectedEntityIds,
538
540
  we as useSlicerContext,
539
- It as useSlicerCounts,
540
- gt as useSlicerPanelHeights,
541
- et as useSlicerPanelSelections,
541
+ gt as useSlicerCounts,
542
+ wt as useSlicerPanelHeights,
543
+ st as useSlicerPanelSelections,
542
544
  ve as useSlicerRemotes,
543
545
  Te as useSlicerRowSelection,
544
- mt as useSlicerSplitter
546
+ Pt as useSlicerSplitter
545
547
  };