@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
package/dist/Slicer.es.js CHANGED
@@ -1,6 +1,7 @@
1
- import { S as K, b as V, d as $, u as j, a as z, c as B } from "./chunks/Slicer.es.js";
2
- import { S as Q, a as U, u as X, b as Z, c as N, d as tt } from "./chunks/entityDefinitions.es.js";
3
- import { useMemo as E, useState as p, useEffect as k } from "react";
1
+ import { S as Z, a as ee, b as te, c as se, d as re, e as oe, f as ie, g as ne, r as de, u as le, h as ce, i as ae, j as ue, k as pe } from "./chunks/Slicer.es.js";
2
+ import { u as k } from "./chunks/entityDefinitions.es.js";
3
+ import { S as Ie, a as Se, b as ye, c as he, d as Ee, e as me } from "./chunks/entityDefinitions.es.js";
4
+ import { useMemo as h, useState as y, useEffect as P } from "react";
4
5
  import "./chunks/ProjectContext.es.js";
5
6
  import "./chunks/GlobalContext.es.js";
6
7
  import "./chunks/MetaWidget.es.js";
@@ -8,135 +9,139 @@ import "lodash";
8
9
  import "primereact/confirmdialog";
9
10
  import "react-toastify";
10
11
  import "uuid";
11
- import { ay as I, aq as v } from "./chunks/searchTerms.es.js";
12
+ import { ay as m, aq as _ } from "./chunks/searchTerms.es.js";
12
13
  import "./chunks/getUris.es.js";
13
- import { useDispatch as g } from "react-redux";
14
- import { S as et, a as rt, u as ot } from "./chunks/useSlicerSplitter.es.js";
15
- const D = ({
16
- sliceFilter: t,
17
- persistedHierarchySelection: s,
18
- filters: e,
19
- merge: n = !0
20
- }) => E(() => {
21
- const r = (a) => ({
14
+ import { useDispatch as R } from "react-redux";
15
+ import { u as F } from "./chunks/useLocalStorage.es.js";
16
+ const B = ({
17
+ sliceFilter: e,
18
+ persistedHierarchySelection: t,
19
+ filters: r,
20
+ merge: d = !0
21
+ }) => h(() => {
22
+ const i = (n) => ({
22
23
  id: "hierarchy",
23
24
  label: "Folder",
24
25
  type: "list_of_strings",
25
- values: Object.keys(a).filter((i) => a[i]).map((i) => ({ id: i, label: i })),
26
+ values: Object.keys(n).filter((l) => n[l]).map((l) => ({ id: l, label: l })),
26
27
  isCustom: !0,
27
28
  singleSelect: !0,
28
29
  fieldType: "folder",
29
30
  operator: "OR",
30
31
  isReadonly: !0
31
32
  });
32
- return t && s ? n ? [r(s), ...e] : [r(s)] : e;
33
- }, [t, s, e]), w = async (t, s, e) => {
34
- const n = new Set(t.folderIds), d = new Set(t.taskIds), r = new Set(t.versionIds), a = new Set(t.productIds), i = [];
35
- return t.taskIds.length && i.push(
36
- e(
37
- I.endpoints.GetTasksList.initiate({
38
- projectName: s,
39
- taskIds: t.taskIds,
40
- first: t.taskIds.length
33
+ return e && t ? d ? [i(t), ...r] : [i(t)] : r;
34
+ }, [e, t, r]), C = async (e, t, r) => {
35
+ const d = new Set(e.folderIds), o = new Set(e.taskIds), i = new Set(e.versionIds), n = new Set(e.productIds), l = {}, a = {}, I = {}, p = [];
36
+ return e.taskIds.length && p.push(
37
+ r(
38
+ m.endpoints.GetTasksList.initiate({
39
+ projectName: t,
40
+ taskIds: e.taskIds,
41
+ first: e.taskIds.length
41
42
  })
42
- ).unwrap().then((c) => {
43
- for (const o of c.tasks)
44
- o.folderId && n.add(o.folderId);
43
+ ).unwrap().then((u) => {
44
+ for (const s of u.tasks)
45
+ s.folderId && (d.add(s.folderId), l[s.id] = s.folderId);
45
46
  })
46
- ), t.versionIds.length && i.push(
47
- e(
48
- I.endpoints.GetVersions.initiate({
49
- projectName: s,
50
- versionIds: t.versionIds,
51
- first: t.versionIds.length
47
+ ), e.versionIds.length && p.push(
48
+ r(
49
+ m.endpoints.GetVersions.initiate({
50
+ projectName: t,
51
+ versionIds: e.versionIds,
52
+ first: e.versionIds.length
52
53
  })
53
- ).unwrap().then((c) => {
54
- for (const o of c.versions)
55
- o.task?.id && d.add(o.task.id), o.product?.id && a.add(o.product.id), o.product?.folder?.id && n.add(o.product.folder.id);
54
+ ).unwrap().then((u) => {
55
+ for (const s of u.versions)
56
+ s.task?.id && o.add(s.task.id), s.product?.id && n.add(s.product.id), s.product?.folder?.id && (d.add(s.product.folder.id), a[s.id] = s.product.folder.id, s.product?.id && (I[s.product.id] = s.product.folder.id));
56
57
  })
57
- ), t.productIds.length && i.push(
58
- e(
59
- I.endpoints.GetProducts.initiate({
60
- projectName: s,
61
- productIds: t.productIds,
62
- first: t.productIds.length
58
+ ), e.productIds.length && p.push(
59
+ r(
60
+ m.endpoints.GetProducts.initiate({
61
+ projectName: t,
62
+ productIds: e.productIds,
63
+ first: e.productIds.length
63
64
  })
64
- ).unwrap().then((c) => {
65
- for (const o of c.products)
66
- o.folderId && n.add(o.folderId);
65
+ ).unwrap().then((u) => {
66
+ for (const s of u.products)
67
+ s.folderId && (d.add(s.folderId), I[s.id] = s.folderId);
67
68
  })
68
- ), await Promise.all(i), {
69
- folderIds: [...n],
70
- taskIds: [...d],
71
- versionIds: [...r],
72
- productIds: [...a]
69
+ ), await Promise.all(p), {
70
+ folderIds: [...d],
71
+ taskIds: [...o],
72
+ versionIds: [...i],
73
+ productIds: [...n],
74
+ parentMaps: { taskFolderIds: l, versionFolderIds: a, productFolderIds: I }
73
75
  };
74
- }, l = {
76
+ }, f = {
75
77
  folderIds: [],
76
78
  taskIds: [],
77
79
  versionIds: [],
78
80
  productIds: []
79
- }, T = (t) => {
80
- const s = {
81
+ }, g = {
82
+ taskFolderIds: {},
83
+ versionFolderIds: {},
84
+ productFolderIds: {}
85
+ }, b = (e) => {
86
+ const t = {
81
87
  folder: /* @__PURE__ */ new Set(),
82
88
  task: /* @__PURE__ */ new Set(),
83
89
  version: /* @__PURE__ */ new Set(),
84
90
  product: /* @__PURE__ */ new Set()
85
91
  };
86
- for (const { entityType: e, entityIds: n } of t) {
87
- const d = s[e];
88
- if (d)
89
- for (const r of n)
90
- d.add(r);
92
+ for (const { entityType: r, entityIds: d } of e) {
93
+ const o = t[r];
94
+ if (o)
95
+ for (const i of d)
96
+ o.add(i);
91
97
  }
92
98
  return {
93
- folderIds: [...s.folder],
94
- taskIds: [...s.task],
95
- versionIds: [...s.version],
96
- productIds: [...s.product]
99
+ folderIds: [...t.folder],
100
+ taskIds: [...t.task],
101
+ versionIds: [...t.version],
102
+ productIds: [...t.product]
97
103
  };
98
- }, M = ({
99
- rowSelection: t,
100
- sliceType: s,
101
- projectName: e
104
+ }, J = ({
105
+ slices: e,
106
+ projectName: t
102
107
  }) => {
103
- const n = g(), [d, r] = p(l), [a, i] = p(l), [c, o] = p(!1);
104
- return k(() => {
105
- if (s !== "entityList" || !e) {
106
- r(l), i(l);
108
+ const r = R(), [d, o] = y(f), [i, n] = y(f), [l, a] = y(g), [I, p] = y(""), u = e.find((c) => c.sliceType === "entityList")?.rowSelection, s = h(
109
+ () => Object.keys(u ?? {}).filter((c) => u?.[c] && !c.startsWith("folder-")).sort(),
110
+ [u]
111
+ ), S = s.length && t ? `${t}|${s}` : "";
112
+ return P(() => {
113
+ if (!S) {
114
+ o(f), n(f), a(g), p("");
107
115
  return;
108
116
  }
109
- const S = Object.keys(t).filter(
110
- (u) => t[u] && !u.startsWith("folder-")
111
- );
112
- if (!S.length) {
113
- r(l), i(l);
114
- return;
115
- }
116
- let f = !1;
117
- return o(!0), (async () => {
117
+ let c = !1;
118
+ return (async () => {
118
119
  try {
119
- const u = await Promise.all(
120
- S.map(
121
- (m) => n(
122
- v.endpoints.getListEntities.initiate({ projectName: e, listId: m })
120
+ const E = await Promise.all(
121
+ s.map(
122
+ (T) => r(
123
+ _.endpoints.getListEntities.initiate({ projectName: t, listId: T })
123
124
  ).unwrap()
124
125
  )
125
- ), y = T(u);
126
- f || i(y);
127
- const h = await w(y, e, n);
128
- f || r(h);
129
- } catch (u) {
130
- console.error("Error fetching entity list IDs:", u), f || (r(l), i(l));
126
+ ), v = b(E);
127
+ c || n(v);
128
+ const { parentMaps: w, ...L } = await C(
129
+ v,
130
+ t,
131
+ r
132
+ );
133
+ c || (o(L), a(w));
134
+ } catch (E) {
135
+ console.error("Error fetching entity list IDs:", E), c || (o(f), n(f), a(g));
131
136
  } finally {
132
- f || o(!1);
137
+ c || p(S);
133
138
  }
134
139
  })(), () => {
135
- f = !0;
140
+ c = !0;
136
141
  };
137
- }, [s, t, e, n]), { entityIds: d, rawEntityIds: a, isLoading: c };
138
- }, H = ({ slice: t, attribFields: s }) => {
139
- const e = {
142
+ }, [S, s, t, r]), { entityIds: d, rawEntityIds: i, parentMaps: l, isLoading: S !== I };
143
+ }, M = ({ slice: e, attribFields: t }) => {
144
+ const r = {
140
145
  assignees: "list_of_strings",
141
146
  status: "string",
142
147
  taskType: "string",
@@ -144,41 +149,68 @@ const D = ({
144
149
  author: "string",
145
150
  hierarchy: void 0,
146
151
  entityList: void 0,
147
- ...s.reduce((d, r) => (d["attrib." + r.name] = r.data.type, d), {})
152
+ ...t.reduce((o, i) => (o["attrib." + i.name] = i.data.type, o), {})
148
153
  };
149
154
  return (() => {
150
- if (!t) return null;
151
- const d = e[t?.sliceType], r = Object.keys(t.rowSelection).filter((a) => !!a).map((a) => ({
152
- id: a,
153
- label: a
155
+ if (!e) return null;
156
+ const o = r[e?.sliceType], i = Object.entries(e.rowSelection).filter(([n, l]) => !!n && l).map(([n]) => ({
157
+ id: n,
158
+ label: n
154
159
  }));
155
160
  return {
156
- id: t?.sliceType,
157
- label: t?.sliceType,
158
- type: d,
161
+ id: e?.sliceType,
162
+ label: e?.sliceType,
163
+ type: o,
159
164
  inverted: !1,
160
165
  operator: "OR",
161
- values: r
166
+ values: i
162
167
  };
163
168
  })();
169
+ }, O = ({
170
+ slices: e,
171
+ attribFields: t
172
+ }) => e.filter((r) => r.sliceType !== "hierarchy" && r.sliceType !== "entityList").map((r) => M({ slice: r, attribFields: t })).filter((r) => !!r), N = (e) => {
173
+ const { slices: t, getPanelSelection: r } = k(), { powerLicense: d, isLoading: o } = F(), i = h(() => {
174
+ const l = t.map((a) => ({
175
+ sliceType: a.sliceType,
176
+ rowSelection: r(a.id)
177
+ }));
178
+ return d ? l : l.slice(0, 1);
179
+ }, [t, r, d]), n = h(
180
+ () => O({ slices: i, attribFields: e }),
181
+ [i, e]
182
+ );
183
+ return {
184
+ sliceSelections: i,
185
+ sliceFilters: n,
186
+ isLicensePending: t.length > 1 && o
187
+ };
164
188
  };
165
189
  export {
166
- Q as SLICER_PAGES_CONFIG,
167
- et as SLICER_SPLITTER_PANEL_CONFIG,
168
- rt as SLICER_SPLITTER_STATE_KEY,
169
- K as Slicer,
170
- U as SlicerProvider,
171
- V as buildListFolderRowId,
172
- H as createFilterFromSlicer,
173
- $ as defaultSliceOptions,
174
- j as useEntityListsSlice,
175
- D as useFiltersWithHierarchy,
176
- z as useHierarchyContextMenuItems,
177
- X as useOptionalSlicerContext,
178
- M as useSelectedEntityIds,
179
- Z as useSlicerContext,
180
- B as useSlicerCounts,
181
- N as useSlicerRemotes,
182
- tt as useSlicerRowSelection,
183
- ot as useSlicerSplitter
190
+ Z as SLICER_DEFAULT_PANEL_HEIGHT,
191
+ ee as SLICER_MIN_PANEL_HEIGHT,
192
+ Ie as SLICER_PAGES_CONFIG,
193
+ te as SLICER_SPLITTER_PANEL_CONFIG,
194
+ se as SLICER_SPLITTER_STATE_KEY,
195
+ re as Slicer,
196
+ Se as SlicerProvider,
197
+ oe as buildListFolderRowId,
198
+ ie as clampDraggedHeights,
199
+ M as createFilterFromSlicer,
200
+ O as createFiltersFromSlicer,
201
+ ne as defaultSliceOptions,
202
+ de as resolvePanelLayout,
203
+ le as useEntityListsSlice,
204
+ B as useFiltersWithHierarchy,
205
+ ce as useHierarchyContextMenuItems,
206
+ ye as useHierarchySelection,
207
+ he as useOptionalSlicerContext,
208
+ J as useSelectedEntityIds,
209
+ k as useSlicerContext,
210
+ ae as useSlicerCounts,
211
+ ue as useSlicerPanelHeights,
212
+ N as useSlicerPanelSelections,
213
+ Ee as useSlicerRemotes,
214
+ me as useSlicerRowSelection,
215
+ pe as useSlicerSplitter
184
216
  };