@ynput/ayon-frontend-shared 0.6.0 → 0.6.1

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 (89) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +292 -298
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +32 -35
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4451 -2965
  7. package/dist/SimpleTable.es.js +8 -7
  8. package/dist/Slicer.es.js +451 -147
  9. package/dist/Views.es.js +918 -310
  10. package/dist/chunks/Actions.es.js +9 -4
  11. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  12. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  13. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  14. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  15. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  16. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  17. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  18. package/dist/chunks/EntityPath.es.js +58 -53
  19. package/dist/chunks/EntityPickerDialog.es.js +24 -20
  20. package/dist/chunks/EntityTooltip.es.js +20 -13
  21. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  22. package/dist/chunks/Feed.es.js +1495 -1439
  23. package/dist/chunks/FilterErrorActions.es.js +25 -229
  24. package/dist/chunks/Menu.es.js +21 -17
  25. package/dist/chunks/MenuContext.es.js +14 -65
  26. package/dist/chunks/MenuItem.es.js +34 -24
  27. package/dist/chunks/MetaWidget.es.js +2835 -4301
  28. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  29. package/dist/chunks/PlayableIcon.es.js +1532 -1594
  30. package/dist/chunks/ProjectContext.es.js +102 -66
  31. package/dist/chunks/RepresentationsList.es.js +1 -1
  32. package/dist/chunks/ReviewablesSelector.es.js +457 -458
  33. package/dist/chunks/SimpleForm.es.js +9 -9
  34. package/dist/chunks/SimpleTable.es.js +15 -13
  35. package/dist/chunks/Slicer.es.js +163 -154
  36. package/dist/chunks/TableSettingsFallback.es.js +25 -13
  37. package/dist/chunks/ThumbnailSimple.es.js +150 -261
  38. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  39. package/dist/chunks/VideoPlayer.es.js +24 -28
  40. package/dist/chunks/Watchers.es.js +384 -389
  41. package/dist/chunks/entityDefinitions.es.js +2 -350
  42. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  43. package/dist/chunks/getBundleMode.es.js +61 -16
  44. package/dist/chunks/getUris.es.js +737 -712
  45. package/dist/chunks/searchTerms.es.js +57 -56
  46. package/dist/chunks/useAttributeEnums.es.js +4 -4
  47. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  48. package/dist/chunks/useHierarchySelection.es.js +24 -0
  49. package/dist/chunks/useLoadModule.es.js +74 -0
  50. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  51. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  52. package/dist/chunks/viewUpdateHelper.es.js +67 -50
  53. package/dist/components.es.js +1425 -999
  54. package/dist/context.es.js +791 -80
  55. package/dist/hooks.es.js +115 -120
  56. package/dist/index.es.js +19 -23
  57. package/dist/types/Actions.d.ts +7 -7
  58. package/dist/types/ContextMenu.d.ts +11 -8
  59. package/dist/types/DetailsPanel.d.ts +102 -9
  60. package/dist/types/EntityPickerDialog.d.ts +7 -7
  61. package/dist/types/Feed.d.ts +11 -8
  62. package/dist/types/ListTable.d.ts +7 -7
  63. package/dist/types/NewEntity.d.ts +16 -10
  64. package/dist/types/ProjectTreeTable.d.ts +22 -115
  65. package/dist/types/RepresentationsList.d.ts +7 -7
  66. package/dist/types/SimpleTable.d.ts +11 -8
  67. package/dist/types/Slicer.d.ts +10 -7
  68. package/dist/types/Views.d.ts +10 -7
  69. package/dist/types/api.d.ts +132 -120
  70. package/dist/types/components.d.ts +13 -8
  71. package/dist/types/context.d.ts +56 -16
  72. package/dist/types/hooks.d.ts +7 -7
  73. package/dist/types/index.d.ts +7 -7
  74. package/dist/types/util.d.ts +12 -7
  75. package/dist/util.es.js +72 -71
  76. package/package.json +1 -1
  77. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  78. package/dist/chunks/DetailsPanelContext.es.js +0 -155
  79. package/dist/chunks/GlobalContext.es.js +0 -52
  80. package/dist/chunks/NewEntityContext.es.js +0 -1242
  81. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  82. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  83. package/dist/chunks/VersionUploadContext.es.js +0 -232
  84. package/dist/chunks/ViewsContext.es.js +0 -878
  85. package/dist/chunks/uriUtils.es.js +0 -48
  86. package/dist/chunks/useColumnDragRestriction.es.js +0 -158
  87. package/dist/chunks/useLocalStorage.es.js +0 -355
  88. package/dist/chunks/useSessionStorage.es.js +0 -61
  89. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -1,134 +0,0 @@
1
- import { jsx as R } from "react/jsx-runtime";
2
- import { useRef as k, useState as z, useEffect as B, useMemo as a, useContext as E } from "react";
3
- import "./searchTerms.es.js";
4
- import { bJ as N } from "./getUris.es.js";
5
- import "primereact/confirmdialog";
6
- import { P as y } from "./ProjectFoldersContextInstance.es.js";
7
- const Q = (s, h) => {
8
- const d = k(null), [b, l] = z(!1);
9
- return B(() => {
10
- const u = d.current;
11
- !u || Object.keys(s).some((c) => u[c] !== s[c]) || Object.keys(u).some((c) => u[c] !== s[c]) ? (d.current = { ...s }, l(h)) : h || l(!1);
12
- }, [Object.values(s).join(","), h]), b;
13
- }, D = ({
14
- projectName: s,
15
- children: h
16
- }) => {
17
- const {
18
- data: { folders: d = [] } = {},
19
- isLoading: b,
20
- isFetching: l,
21
- isSuccess: u,
22
- isUninitialized: w,
23
- error: c,
24
- refetch: S
25
- } = N({ projectName: s, attrib: !0 }), F = Q({ projectName: s }, l || b), f = a(() => {
26
- const e = /* @__PURE__ */ new Map();
27
- for (const t of d)
28
- e.set(t.id, t);
29
- return e;
30
- }, [d]), P = a(() => (e) => f.get(e), [f]), C = a(
31
- () => (e, t, n = {}) => {
32
- if (!t.length) return {};
33
- const r = {}, o = new Set(t), p = /* @__PURE__ */ new Set();
34
- let g = e;
35
- for (; o.size > 0 && g && !p.has(g); ) {
36
- p.add(g);
37
- const i = f.get(g);
38
- if (!i) break;
39
- const L = i.attrib || {};
40
- for (const m of Array.from(o))
41
- i.ownAttrib?.includes(m) && m in L && (r[m] = Object.entries(L).find(
42
- ([O]) => O === m
43
- )?.[1], o.delete(m));
44
- g = i.parentId;
45
- }
46
- for (const i of Array.from(o))
47
- i in n && (r[i] = n[i], o.delete(i));
48
- for (const i of o)
49
- r[i] = null;
50
- return r;
51
- },
52
- [f]
53
- ), I = a(
54
- () => (e) => {
55
- const t = [], n = /* @__PURE__ */ new Set();
56
- let r = e;
57
- for (; r && !n.has(r); ) {
58
- n.add(r);
59
- const o = f.get(r);
60
- if (!o?.parentId) break;
61
- t.push(o.parentId), r = o.parentId;
62
- }
63
- return t;
64
- },
65
- [f]
66
- ), v = a(
67
- () => (e) => {
68
- const t = new Set(e);
69
- return e.filter((n) => !I(n).some((r) => t.has(r)));
70
- },
71
- [I]
72
- ), x = a(() => {
73
- const e = /* @__PURE__ */ new Map();
74
- for (const t of d) {
75
- if (!t.parentId) continue;
76
- const n = e.get(t.parentId);
77
- n ? n.push(t.id) : e.set(t.parentId, [t.id]);
78
- }
79
- return e;
80
- }, [d]), j = a(
81
- () => (e, t = !1) => {
82
- const n = t ? [...e] : [], r = [...e];
83
- for (; r.length > 0; ) {
84
- const o = r.shift();
85
- for (const p of x.get(o) || [])
86
- n.push(p), r.push(p);
87
- }
88
- return n;
89
- },
90
- [x]
91
- ), A = () => S().unwrap(), M = a(
92
- () => ({
93
- folders: d,
94
- getFolderById: P,
95
- findNonInheritedValues: C,
96
- getParentFolderIds: I,
97
- getFolderIdsWithoutChildren: v,
98
- getChildFolderIds: j,
99
- isLoading: F,
100
- // first time and when args change
101
- isFetching: l,
102
- // any background fetching
103
- isSuccess: u,
104
- isUninitialized: w,
105
- error: c,
106
- refetch: A
107
- }),
108
- [
109
- d,
110
- P,
111
- C,
112
- I,
113
- v,
114
- j,
115
- F,
116
- l,
117
- u,
118
- w,
119
- c,
120
- A
121
- ]
122
- );
123
- return /* @__PURE__ */ R(y.Provider, { value: M, children: h });
124
- }, H = () => {
125
- const s = E(y);
126
- if (s === void 0)
127
- throw new Error("useProjectFoldersContext must be used within a ProjectFoldersContextProvider");
128
- return s;
129
- };
130
- export {
131
- D as P,
132
- Q as a,
133
- H as u
134
- };
@@ -1,7 +0,0 @@
1
- import { createContext as o } from "react";
2
- const e = o(
3
- void 0
4
- );
5
- export {
6
- e as P
7
- };
@@ -1,232 +0,0 @@
1
- import { jsx as pe } from "react/jsx-runtime";
2
- import "./searchTerms.es.js";
3
- import { bK as ve, bP as me, ct as Ie, aJ as Ve, aO as ke } from "./getUris.es.js";
4
- import "primereact/confirmdialog";
5
- import { createContext as Pe, useState as r, useRef as oe, useMemo as ie, useCallback as I, useEffect as A, useContext as de } from "react";
6
- import "lodash";
7
- import { toast as ae } from "react-toastify";
8
- import "uuid";
9
- import { c as Te, a as he, e as we, v as ye } from "./versionUploadHelpers.es.js";
10
- import { p as Fe } from "./parseFilename.es.js";
11
- const G = Pe(void 0), P = {
12
- version: 1,
13
- name: "review",
14
- productType: "review"
15
- }, Ae = ({
16
- children: F,
17
- projectName: f,
18
- onVersionCreated: M,
19
- dispatch: Q
20
- }) => {
21
- const [l, g] = r(""), [n, x] = r(""), [T, V] = r(null), [D, m] = r(null), [i, B] = r(!1), [k, O] = r([]), [p, o] = r(P), [H, C] = r(!1), [J, b] = r(""), [K, q] = r(null), [z, W] = r(null), [U, X] = r(void 0), [E, Y] = r(void 0), v = oe(!1), Z = oe(null), { data: a = [], isLoading: _ } = ve(
22
- { projectName: f, folderId: l },
23
- { skip: !l || !i || !!n }
24
- ), d = ie(() => {
25
- if (!(n || !p.name || a.length === 0))
26
- return a.find((e) => e.name === p.name);
27
- }, [n, p.name, a]), u = n || d?.id || "", { currentData: L } = me(
28
- {
29
- projectName: f,
30
- productId: n
31
- },
32
- { skip: !n || !i || U != null }
33
- ), { data: $ } = Ie(
34
- { projectName: f, versionId: E },
35
- { skip: !E || !i || T !== null }
36
- ), h = T ?? $?.taskId ?? "", N = !!(E && T === null && !$), j = I(
37
- ({ productId: e, folderId: s, taskId: t, linkedTask: c, latestVersionNumber: y, latestVersionId: ce }) => {
38
- x(e || ""), g(s || ""), V(t || null), m(c || null), X(y), Y(ce), o((fe) => ({
39
- ...fe,
40
- ...y != null ? { version: y + 1 } : {}
41
- })), B(!0);
42
- },
43
- []
44
- ), w = I(() => {
45
- k.forEach((e) => {
46
- e.preview && URL.revokeObjectURL(e.preview);
47
- }), O([]), o(P), q(null), W(null), b(""), C(!1), B(!1), x(""), g(""), V(null), m(null), v.current = !1, X(void 0), Y(void 0);
48
- }, [k]), [le] = Ve(), [ee] = ke(), R = I(
49
- async (e) => {
50
- try {
51
- if (u) {
52
- const s = await Te(ee, f, {
53
- productId: u,
54
- version: e.version,
55
- taskId: h || void 0
56
- });
57
- return M(u, s.id), ae.success("Created new version"), {
58
- productId: u,
59
- versionId: s.id
60
- };
61
- } else {
62
- const { product: s, version: t } = await he(
63
- le,
64
- ee,
65
- f,
66
- {
67
- folderId: l,
68
- name: e.name,
69
- productType: e.productType || "review",
70
- productBaseType: e.productType || "review"
71
- },
72
- {
73
- version: e.version,
74
- taskId: h || void 0
75
- }
76
- );
77
- return M(s.id, t.id), ae.success("Created new version"), {
78
- productId: s.id,
79
- versionId: t.id
80
- };
81
- }
82
- } catch (s) {
83
- throw console.error("Error uploading version:", s), s.message || s;
84
- }
85
- },
86
- [w, u, l, h, f]
87
- ), se = I(
88
- (e) => {
89
- if (u) return;
90
- const s = e[0];
91
- if (s) {
92
- const t = Fe(s.name), c = we(t);
93
- c && c !== p.version && o((y) => ({
94
- ...y,
95
- version: c
96
- }));
97
- }
98
- },
99
- [u, p.version]
100
- ), S = L?.version ?? U ?? d?.latestVersion?.version, te = I((e, s) => {
101
- o((t) => ({
102
- ...t,
103
- [e]: s
104
- })), b("");
105
- }, []), re = I(
106
- async (e) => {
107
- try {
108
- C(!0), b("");
109
- const s = ye(e, S, !u);
110
- if (!s.isValid)
111
- throw s.error;
112
- const t = await R(e);
113
- l && (Z.current = { folderId: l, productName: e.name }), t?.productId && q(t.productId), t?.versionId && W(t.versionId), k.length < 1 && (C(!1), w());
114
- } catch (s) {
115
- b(s), C(!1);
116
- }
117
- },
118
- [R, k.length, w, S, u]
119
- );
120
- A(() => {
121
- if (!(!i || U != null))
122
- return o(L ? (e) => ({ ...e, version: L.version + 1 }) : P), () => {
123
- o(P);
124
- };
125
- }, [i, L, U]), A(() => {
126
- if (!i || n || a.length === 0 || p.name !== P.name) return;
127
- const e = Z.current;
128
- if (e && e.folderId === l && a.some((c) => c.name === e.productName)) {
129
- o((c) => ({ ...c, name: e.productName }));
130
- return;
131
- }
132
- const s = a[a.length - 1];
133
- s && o((t) => ({ ...t, name: s.name }));
134
- }, [i, n, a]), A(() => {
135
- if (!(!i || n))
136
- if (d) {
137
- o((s) => ({
138
- ...s,
139
- productType: d.productType,
140
- ...d.latestVersion && {
141
- version: d.latestVersion.version + 1
142
- }
143
- }));
144
- const e = d.latestVersion?.task;
145
- e && (T === null || v.current) ? (V(e.id), m({
146
- id: e.id,
147
- name: e.name,
148
- label: e.label,
149
- taskType: e.taskType
150
- }), v.current = !0) : !e && v.current && (V(null), m(null), v.current = !1);
151
- } else
152
- o((e) => ({ ...e, version: P.version })), (T === null || v.current) && (V(null), m(null), v.current = !1);
153
- }, [i, n, d]);
154
- const ne = I((e) => {
155
- V(e), v.current = !1;
156
- }, []), ue = ie(
157
- () => ({
158
- productId: n,
159
- setProductId: x,
160
- folderId: l,
161
- taskId: h,
162
- linkedTask: D,
163
- isLoadingTask: N,
164
- setTaskId: ne,
165
- setLinkedTask: m,
166
- setFolderId: g,
167
- isOpen: i,
168
- projectName: f,
169
- latestVersion: S,
170
- pendingFiles: k,
171
- setPendingFiles: O,
172
- onOpenVersionUpload: j,
173
- onCloseVersionUpload: w,
174
- onUploadVersion: R,
175
- extractAndSetVersionFromFiles: se,
176
- form: p,
177
- setForm: o,
178
- isSubmitting: H,
179
- error: J,
180
- createdProductId: K,
181
- createdVersionId: z,
182
- handleFormChange: te,
183
- handleFormSubmit: re,
184
- folderProducts: a,
185
- isFolderProductsLoading: _,
186
- matchedProduct: d,
187
- dispatch: Q
188
- }),
189
- [
190
- l,
191
- g,
192
- n,
193
- h,
194
- D,
195
- N,
196
- ne,
197
- m,
198
- x,
199
- i,
200
- f,
201
- S,
202
- k,
203
- O,
204
- j,
205
- w,
206
- R,
207
- se,
208
- p,
209
- H,
210
- J,
211
- K,
212
- z,
213
- te,
214
- re,
215
- a,
216
- _,
217
- d,
218
- Q
219
- ]
220
- );
221
- return /* @__PURE__ */ pe(G.Provider, { value: ue, children: F });
222
- }, Ge = () => {
223
- const F = de(G);
224
- if (F === void 0)
225
- throw new Error("useVersionUploadContext must be used within a VersionUploadProvider");
226
- return F;
227
- }, Me = () => de(G) ?? null;
228
- export {
229
- Ae as V,
230
- Ge as a,
231
- Me as u
232
- };