@ynput/ayon-frontend-shared 0.4.7 → 0.5.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 (48) hide show
  1. package/dist/DetailsPanel.es.js +684 -651
  2. package/dist/ListTable.es.js +8 -7
  3. package/dist/ProjectTreeTable.es.js +2223 -2184
  4. package/dist/Slicer.es.js +152 -120
  5. package/dist/api.es.js +202 -201
  6. package/dist/chunks/Actions.es.js +20 -20
  7. package/dist/chunks/ColumnDropIndicator.es.js +127 -241
  8. package/dist/chunks/DeleteEntitiesContext.es.js +36 -36
  9. package/dist/chunks/DetailsDialog.es.js +3 -3
  10. package/dist/chunks/EntityPath.es.js +22 -22
  11. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  12. package/dist/chunks/EntityTooltip.es.js +12 -12
  13. package/dist/chunks/Feed.es.js +2 -2
  14. package/dist/chunks/FilterErrorActions.es.js +5 -5
  15. package/dist/chunks/GlobalContext.es.js +14 -14
  16. package/dist/chunks/InfoMessage.es.js +146 -0
  17. package/dist/chunks/Menu.es.js +5 -5
  18. package/dist/chunks/MenuContext.es.js +75 -73
  19. package/dist/chunks/MetaWidget.es.js +1968 -1960
  20. package/dist/chunks/NewEntityContext.es.js +538 -543
  21. package/dist/chunks/PlayableIcon.es.js +54 -54
  22. package/dist/chunks/ProjectContext.es.js +12 -12
  23. package/dist/chunks/ProjectFoldersContext.es.js +84 -76
  24. package/dist/chunks/RepresentationsList.es.js +1 -1
  25. package/dist/chunks/ReviewablesSelector.es.js +387 -384
  26. package/dist/chunks/SimpleTable.es.js +286 -283
  27. package/dist/chunks/Slicer.es.js +1121 -683
  28. package/dist/chunks/VersionUploadContext.es.js +26 -26
  29. package/dist/chunks/ViewsContext.es.js +31 -31
  30. package/dist/chunks/Watchers.es.js +1 -1
  31. package/dist/chunks/entityDefinitions.es.js +275 -133
  32. package/dist/chunks/getUris.es.js +236 -231
  33. package/dist/chunks/searchTerms.es.js +9 -0
  34. package/dist/chunks/useAttributeEnums.es.js +69 -61
  35. package/dist/chunks/useLocalStorage.es.js +10 -10
  36. package/dist/chunks/viewUpdateHelper.es.js +23 -23
  37. package/dist/components.es.js +166 -166
  38. package/dist/hooks.es.js +44 -43
  39. package/dist/index.es.js +11 -10
  40. package/dist/types/DetailsPanel.d.ts +6 -0
  41. package/dist/types/ProjectTreeTable.d.ts +28 -6
  42. package/dist/types/RepresentationsList.d.ts +3 -0
  43. package/dist/types/SimpleTable.d.ts +1 -0
  44. package/dist/types/Slicer.d.ts +103 -18
  45. package/dist/types/api.d.ts +13 -0
  46. package/dist/types/components.d.ts +7 -5
  47. package/package.json +11 -10
  48. package/dist/chunks/useSlicerSplitter.es.js +0 -18
@@ -1,6 +1,6 @@
1
1
  import { jsx as pe } from "react/jsx-runtime";
2
2
  import "./searchTerms.es.js";
3
- import { bI as ve, bN as me, cr as Ie, aI as Ve, aN as ke } from "./getUris.es.js";
3
+ import { bJ as ve, bO as me, cs as Ie, aJ as Ve, aO as ke } from "./getUris.es.js";
4
4
  import "primereact/confirmdialog";
5
5
  import { createContext as Te, useState as r, useRef as oe, useMemo as ie, useCallback as I, useEffect as A, useContext as de } from "react";
6
6
  import "lodash";
@@ -18,7 +18,7 @@ const G = Te(void 0), T = {
18
18
  onVersionCreated: M,
19
19
  dispatch: Q
20
20
  }) => {
21
- const [l, g] = r(""), [n, x] = r(""), [P, V] = r(null), [D, m] = r(null), [i, B] = r(!1), [k, E] = r([]), [p, o] = r(T), [H, C] = r(!1), [q, b] = r(""), [z, J] = r(null), [K, N] = r(null), [U, W] = r(void 0), [O, X] = r(void 0), v = oe(!1), Y = oe(null), { data: a = [], isLoading: Z } = ve(
21
+ const [l, g] = r(""), [n, x] = r(""), [P, V] = r(null), [D, m] = r(null), [i, J] = r(!1), [k, S] = r([]), [p, o] = r(T), [B, C] = r(!1), [H, b] = r(""), [q, z] = r(null), [K, W] = r(null), [U, X] = r(void 0), [E, Y] = r(void 0), v = oe(!1), Z = oe(null), { data: a = [], isLoading: _ } = ve(
22
22
  { projectName: f, folderId: l },
23
23
  { skip: !l || !i || !!n }
24
24
  ), d = ie(() => {
@@ -30,21 +30,21 @@ const G = Te(void 0), T = {
30
30
  productId: n
31
31
  },
32
32
  { skip: !n || !i || U != null }
33
- ), { data: _ } = Ie(
34
- { projectName: f, versionId: O },
35
- { skip: !O || !i || P !== null }
36
- ), h = P ?? _?.taskId ?? "", $ = !!(O && P === null && !_), j = I(
33
+ ), { data: $ } = Ie(
34
+ { projectName: f, versionId: E },
35
+ { skip: !E || !i || P !== null }
36
+ ), h = P ?? $?.taskId ?? "", N = !!(E && P === null && !$), j = I(
37
37
  ({ productId: e, folderId: s, taskId: t, linkedTask: c, latestVersionNumber: y, latestVersionId: ce }) => {
38
- x(e || ""), g(s || ""), V(t || null), m(c || null), W(y), X(ce), o((fe) => ({
38
+ x(e || ""), g(s || ""), V(t || null), m(c || null), X(y), Y(ce), o((fe) => ({
39
39
  ...fe,
40
40
  ...y != null ? { version: y + 1 } : {}
41
- })), B(!0);
41
+ })), J(!0);
42
42
  },
43
43
  []
44
44
  ), w = I(() => {
45
45
  k.forEach((e) => {
46
46
  e.preview && URL.revokeObjectURL(e.preview);
47
- }), E([]), o(T), J(null), N(null), b(""), C(!1), B(!1), x(""), g(""), V(null), m(null), v.current = !1, W(void 0), X(void 0);
47
+ }), S([]), o(T), z(null), W(null), b(""), C(!1), J(!1), x(""), g(""), V(null), m(null), v.current = !1, X(void 0), Y(void 0);
48
48
  }, [k]), [le] = Ve(), [ee] = ke(), R = I(
49
49
  async (e) => {
50
50
  try {
@@ -97,7 +97,7 @@ const G = Te(void 0), T = {
97
97
  }
98
98
  },
99
99
  [u, p.version]
100
- ), S = L?.version ?? U ?? d?.latestVersion?.version, te = I((e, s) => {
100
+ ), O = L?.version ?? U ?? d?.latestVersion?.version, te = I((e, s) => {
101
101
  o((t) => ({
102
102
  ...t,
103
103
  [e]: s
@@ -106,16 +106,16 @@ const G = Te(void 0), T = {
106
106
  async (e) => {
107
107
  try {
108
108
  C(!0), b("");
109
- const s = ye(e, S, !u);
109
+ const s = ye(e, O, !u);
110
110
  if (!s.isValid)
111
111
  throw s.error;
112
112
  const t = await R(e);
113
- l && (Y.current = { folderId: l, productName: e.name }), t?.productId && J(t.productId), t?.versionId && N(t.versionId), k.length < 1 && (C(!1), w());
113
+ l && (Z.current = { folderId: l, productName: e.name }), t?.productId && z(t.productId), t?.versionId && W(t.versionId), k.length < 1 && (C(!1), w());
114
114
  } catch (s) {
115
115
  b(s), C(!1);
116
116
  }
117
117
  },
118
- [R, k.length, w, S, u]
118
+ [R, k.length, w, O, u]
119
119
  );
120
120
  A(() => {
121
121
  if (!(!i || U != null))
@@ -124,7 +124,7 @@ const G = Te(void 0), T = {
124
124
  };
125
125
  }, [i, L, U]), A(() => {
126
126
  if (!i || n || a.length === 0 || p.name !== T.name) return;
127
- const e = Y.current;
127
+ const e = Z.current;
128
128
  if (e && e.folderId === l && a.some((c) => c.name === e.productName)) {
129
129
  o((c) => ({ ...c, name: e.productName }));
130
130
  return;
@@ -160,29 +160,29 @@ const G = Te(void 0), T = {
160
160
  folderId: l,
161
161
  taskId: h,
162
162
  linkedTask: D,
163
- isLoadingTask: $,
163
+ isLoadingTask: N,
164
164
  setTaskId: ne,
165
165
  setLinkedTask: m,
166
166
  setFolderId: g,
167
167
  isOpen: i,
168
168
  projectName: f,
169
- latestVersion: S,
169
+ latestVersion: O,
170
170
  pendingFiles: k,
171
- setPendingFiles: E,
171
+ setPendingFiles: S,
172
172
  onOpenVersionUpload: j,
173
173
  onCloseVersionUpload: w,
174
174
  onUploadVersion: R,
175
175
  extractAndSetVersionFromFiles: se,
176
176
  form: p,
177
177
  setForm: o,
178
- isSubmitting: H,
179
- error: q,
180
- createdProductId: z,
178
+ isSubmitting: B,
179
+ error: H,
180
+ createdProductId: q,
181
181
  createdVersionId: K,
182
182
  handleFormChange: te,
183
183
  handleFormSubmit: re,
184
184
  folderProducts: a,
185
- isFolderProductsLoading: Z,
185
+ isFolderProductsLoading: _,
186
186
  matchedProduct: d,
187
187
  dispatch: Q
188
188
  }),
@@ -192,28 +192,28 @@ const G = Te(void 0), T = {
192
192
  n,
193
193
  h,
194
194
  D,
195
- $,
195
+ N,
196
196
  ne,
197
197
  m,
198
198
  x,
199
199
  i,
200
200
  f,
201
- S,
201
+ O,
202
202
  k,
203
- E,
203
+ S,
204
204
  j,
205
205
  w,
206
206
  R,
207
207
  se,
208
208
  p,
209
+ B,
209
210
  H,
210
211
  q,
211
- z,
212
212
  K,
213
213
  te,
214
214
  re,
215
215
  a,
216
- Z,
216
+ _,
217
217
  d,
218
218
  Q
219
219
  ]
@@ -1,10 +1,10 @@
1
1
  import { jsxs as ae, jsx as v } from "react/jsx-runtime";
2
2
  import { forwardRef as Z, useMemo as F, useCallback as b, useRef as De, useState as Y, createContext as Ie, useContext as Ee } from "react";
3
3
  import "./searchTerms.es.js";
4
- import { aO as j, bp as Me, d0 as N, b2 as ne, dq as ce, dt as M, S as J, cd as Pe, cR as _e, cy as We, bl as oe, cw as Re } from "./getUris.es.js";
4
+ import { aP as j, bq as Pe, d1 as N, b3 as ne, dr as ce, du as P, S as J, ce as Me, cS as _e, cz as We, bm as oe, cx as Re } from "./getUris.es.js";
5
5
  import { confirmDialog as Fe } from "primereact/confirmdialog";
6
6
  import { Button as Oe, theme as le, Icon as de } from "@ynput/ayon-react-components";
7
- import P from "styled-components";
7
+ import M from "styled-components";
8
8
  import K from "clsx";
9
9
  import { a as qe, K as re } from "./platform.es.js";
10
10
  import "lodash";
@@ -12,9 +12,9 @@ import { toast as m } from "react-toastify";
12
12
  import { v4 as Ge } from "uuid";
13
13
  import { u as Qe } from "./GlobalContext.es.js";
14
14
  import { u as ue, a as Ue, e as Ke } from "./useLocalStorage.es.js";
15
- import { useDispatch as He } from "react-redux";
16
- const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
17
- id: ze(),
15
+ import { useDispatch as ze } from "react-redux";
16
+ const He = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
17
+ id: He(),
18
18
  label: "Working",
19
19
  working: !0,
20
20
  settings: e
@@ -25,7 +25,7 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
25
25
  "lists",
26
26
  "reviews",
27
27
  "reports"
28
- ], ge = "_working_", Lt = "_new_view_", Ve = "__base__", Ae = P.li`
28
+ ], ge = "_working_", Lt = "_new_view_", Ve = "__base__", Ae = M.li`
29
29
  position: relative;
30
30
  padding: 4px 6px 4px 12px;
31
31
  user-select: none;
@@ -78,7 +78,7 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
78
78
  display: flex;
79
79
  }
80
80
  }
81
- `, X = P(Oe)`
81
+ `, X = M(Oe)`
82
82
  &.hasIcon {
83
83
  padding: 2px;
84
84
  }
@@ -165,10 +165,10 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
165
165
  }
166
166
  );
167
167
  }
168
- ), Xe = P.div`
168
+ ), Xe = M.div`
169
169
  overflow: auto;
170
170
  max-height: 40vh;
171
- `, Ye = P.ul`
171
+ `, Ye = M.ul`
172
172
  /* reset defaults */
173
173
  margin: 0;
174
174
  padding: 0;
@@ -178,16 +178,16 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
178
178
  flex-direction: column;
179
179
  gap: var(--base-gap-small);
180
180
  margin-bottom: var(--padding-s);
181
- `, Ze = P.li`
181
+ `, Ze = M.li`
182
182
  height: 1px;
183
183
  background-color: var(--md-sys-color-outline-variant);
184
184
  margin: 4px 0;
185
185
  `;
186
- P.li`
186
+ M.li`
187
187
  ${le.labelSmall}
188
188
  color: var(--md-sys-color-outline);
189
189
  `;
190
- const je = P.li`
190
+ const je = M.li`
191
191
  ${le.labelSmall}
192
192
  color: var(--md-sys-color-outline);
193
193
  user-select: none;
@@ -391,13 +391,13 @@ const je = P.li`
391
391
  }), !G)
392
392
  r.push(...B.items);
393
393
  else if (l) {
394
- const Q = B.items.find((H) => H.id === l);
394
+ const Q = B.items.find((z) => z.id === l);
395
395
  Q && r.push(Q);
396
396
  }
397
397
  }), r;
398
398
  }, [L, O, g, E, l, c]);
399
399
  }, it = ({ viewType: e, projectName: t }) => {
400
- const { currentData: n, isLoading: s } = Me(
400
+ const { currentData: n, isLoading: s } = Pe(
401
401
  { viewType: e, projectName: t },
402
402
  { skip: !e }
403
403
  ), [o] = N(), d = De({}), u = d.current[e];
@@ -424,7 +424,7 @@ const je = P.li`
424
424
  onDelete: o,
425
425
  onUpdate: d
426
426
  }) => {
427
- const u = He(), [V] = j(), [g] = ne(), [i] = ce(), [f] = N(), x = b(
427
+ const u = ze(), [V] = j(), [g] = ne(), [i] = ce(), [f] = N(), x = b(
428
428
  async (c, a) => {
429
429
  if (!e)
430
430
  throw new Error("viewType are required for creating a view");
@@ -477,13 +477,13 @@ const je = P.li`
477
477
  throw new Error("viewType are required for resetting a view");
478
478
  try {
479
479
  u(
480
- M.util.invalidateTags([
480
+ P.util.invalidateTags([
481
481
  { type: "Views", id: `base-${e}-${t}` },
482
482
  { type: "Views", id: `base-${e}` }
483
483
  ])
484
484
  );
485
485
  const S = (await u(
486
- M.endpoints.getBaseView.initiate(
486
+ P.endpoints.getBaseView.initiate(
487
487
  { viewType: e, projectName: t },
488
488
  { subscribe: !1, forceRefetch: !0 }
489
489
  )
@@ -493,7 +493,7 @@ const je = P.li`
493
493
  I = S.settings, k = "project";
494
494
  else {
495
495
  const r = (await u(
496
- M.endpoints.getBaseView.initiate(
496
+ P.endpoints.getBaseView.initiate(
497
497
  { viewType: e },
498
498
  { subscribe: !1, forceRefetch: !0 }
499
499
  )
@@ -556,7 +556,7 @@ const je = P.li`
556
556
  projectName: w ? void 0 : t
557
557
  }).unwrap();
558
558
  o(
559
- M.util.invalidateTags([
559
+ P.util.invalidateTags([
560
560
  { type: "view", id: a.id },
561
561
  J(e, w ? void 0 : t)
562
562
  ])
@@ -578,7 +578,7 @@ const je = P.li`
578
578
  projectName: l ? void 0 : t,
579
579
  payload: { settings: n || {} }
580
580
  }).unwrap(), o(
581
- M.util.invalidateTags([
581
+ P.util.invalidateTags([
582
582
  { type: "view", id: w },
583
583
  J(e, l ? void 0 : t)
584
584
  ])
@@ -599,7 +599,7 @@ const je = P.li`
599
599
  viewType: e,
600
600
  projectName: l ? void 0 : t
601
601
  }).unwrap(), o(
602
- M.util.invalidateTags([
602
+ P.util.invalidateTags([
603
603
  { type: "view", id: w },
604
604
  J(e, l ? void 0 : t)
605
605
  ])
@@ -618,7 +618,7 @@ const je = P.li`
618
618
  if (!s?.id)
619
619
  throw new Error("No working view available to update");
620
620
  const a = (await o(
621
- M.endpoints.getBaseView.initiate(
621
+ P.endpoints.getBaseView.initiate(
622
622
  {
623
623
  viewType: e,
624
624
  projectName: w ? void 0 : t
@@ -708,7 +708,7 @@ const je = P.li`
708
708
  const ie = { ...w };
709
709
  ie[U] = !1, l(ie);
710
710
  }
711
- }, { data: a } = Pe(
711
+ }, { data: a } = Me(
712
712
  { projectName: s },
713
713
  { skip: !u || !f }
714
714
  ), [h, y, D, _] = it({
@@ -739,10 +739,10 @@ const je = P.li`
739
739
  ), { currentData: G, isLoading: Q } = oe(
740
740
  { projectName: s, viewType: t },
741
741
  { skip: !t }
742
- ), { currentData: H, isLoading: pe } = oe(
742
+ ), { currentData: z, isLoading: pe } = oe(
743
743
  { projectName: void 0, viewType: t },
744
744
  { skip: !t }
745
- ), me = I || _ || C || Q || pe, T = r?.settings, z = h?.id === ge ? T : h?.settings, ee = h?.id === r?.id, te = W && ee && D && D !== r?.id ? D : void 0, { currentData: A, isFetching: ve } = Re(
745
+ ), me = I || _ || C || Q || pe, T = r?.settings, H = h?.id === ge ? T : h?.settings, ee = h?.id === r?.id, te = W && ee && D && D !== r?.id ? D : void 0, { currentData: A, isFetching: ve } = Re(
746
746
  {
747
747
  viewId: f,
748
748
  projectName: fe(f, k) ? void 0 : s,
@@ -756,12 +756,12 @@ const je = P.li`
756
756
  viewType: t,
757
757
  projectName: s,
758
758
  viewsList: k,
759
- sourceSettings: z,
759
+ sourceSettings: H,
760
760
  onUpdateView: L
761
761
  }), { onCreateBaseView: ye, onUpdateBaseView: Ce, onDeleteBaseView: xe, onLoadBaseView: Se } = rt({
762
762
  viewType: t,
763
763
  projectName: s,
764
- viewSettings: z,
764
+ viewSettings: H,
765
765
  workingView: r,
766
766
  dispatch: o
767
767
  }), Le = b(
@@ -811,7 +811,7 @@ const je = P.li`
811
811
  editingView: f,
812
812
  currentUser: V,
813
813
  selectedView: h,
814
- viewSettings: z,
814
+ viewSettings: H,
815
815
  editingViewData: be,
816
816
  isLoadingEditingViewData: ve,
817
817
  viewsList: k,
@@ -822,7 +822,7 @@ const je = P.li`
822
822
  onUpdateWorkingView: Le,
823
823
  // base views
824
824
  projectBaseView: G,
825
- studioBaseView: H,
825
+ studioBaseView: z,
826
826
  // base view mutations
827
827
  onCreateBaseView: ye,
828
828
  onUpdateBaseView: Ce,
@@ -845,7 +845,7 @@ const je = P.li`
845
845
  // shared actions
846
846
  resetWorkingView: se,
847
847
  // api
848
- api: M,
848
+ api: P,
849
849
  dispatch: o
850
850
  };
851
851
  return /* @__PURE__ */ v(he.Provider, { value: $e, children: e });
@@ -864,7 +864,7 @@ export {
864
864
  Je as a,
865
865
  Te as b,
866
866
  $t as c,
867
- ze as d,
867
+ He as d,
868
868
  tt as e,
869
869
  rt as f,
870
870
  we as g,
@@ -11,7 +11,7 @@ import z from "clsx";
11
11
  import { BorderedSection as I, Button as L, StatusSelect as Ee, AssigneeSelect as Se, TagsSelect as Te, EnumDropdown as De, Icon as R, getMimeTypeIcon as Fe, theme as je, getFileSizeString as Ce, WatcherSelect as Ae } from "@ynput/ayon-react-components";
12
12
  import { l as Ne, M as $e, T as ze, j as Ue, k as Re, D as Le } from "./MetaWidget.es.js";
13
13
  import "./PlayableIcon.es.js";
14
- import { dd as Me, c4 as le, bd as Pe, an as We, bs as Oe, d1 as Ie } from "./getUris.es.js";
14
+ import { de as Me, c5 as le, be as Pe, an as We, bt as Oe, d2 as Ie } from "./getUris.es.js";
15
15
  import "./useLocalStorage.es.js";
16
16
  import "@module-federation/enhanced/runtime";
17
17
  import "semver";