@ynput/ayon-frontend-shared 0.7.4 → 0.7.6
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.
- package/dist/DetailsPanel.es.js +376 -380
- package/dist/ListTable.es.js +2 -2
- package/dist/NewEntity.es.js +26 -26
- package/dist/ProjectTreeTable.es.js +2521 -2510
- package/dist/ProjectsTable.es.js +3 -3
- package/dist/Slicer.es.js +32 -32
- package/dist/Views.es.js +1 -1
- package/dist/chunks/ColumnDropIndicator.es.js +2 -2
- package/dist/chunks/ColumnHeaderMenuUI.es.js +1 -1
- package/dist/chunks/EntityPath.es.js +1 -1
- package/dist/chunks/EntityPickerDialog.es.js +481 -460
- package/dist/chunks/EntityTooltip.es.js +1 -1
- package/dist/chunks/Feed.es.js +11 -10
- package/dist/chunks/FilterErrorActions.es.js +1 -1
- package/dist/chunks/GroupSettingsFallback.es.js +2 -2
- package/dist/chunks/Menu.es.js +250 -247
- package/dist/chunks/MetaWidget.es.js +2 -2
- package/dist/chunks/PlayableIcon.es.js +368 -368
- package/dist/chunks/ProjectFoldersContext.es.js +237 -0
- package/dist/chunks/ReviewablesSelector.es.js +1223 -1170
- package/dist/chunks/SimpleTable.es.js +301 -296
- package/dist/chunks/Slicer.es.js +418 -410
- package/dist/chunks/TableExportContextInstance.es.js +428 -382
- package/dist/chunks/ThumbnailUploaderContext.es.js +48 -0
- package/dist/chunks/Watchers.es.js +2 -2
- package/dist/chunks/{ColumnDropIndicator.styled.es.js → addonColumnTags.es.js} +60 -47
- package/dist/components.es.js +1404 -1274
- package/dist/context.es.js +559 -657
- package/dist/hooks.es.js +2 -2
- package/dist/index.es.js +2 -2
- package/dist/types/Actions.d.ts +16 -16
- package/dist/types/ContextMenu.d.ts +16 -16
- package/dist/types/DetailsPanel.d.ts +16 -16
- package/dist/types/EntityPickerDialog.d.ts +61 -18
- package/dist/types/Feed.d.ts +16 -16
- package/dist/types/ListTable.d.ts +16 -16
- package/dist/types/NewEntity.d.ts +16 -16
- package/dist/types/ProjectTreeTable.d.ts +135 -33
- package/dist/types/ProjectsTable.d.ts +16 -16
- package/dist/types/RepresentationsList.d.ts +16 -16
- package/dist/types/SimpleTable.d.ts +16 -16
- package/dist/types/Slicer.d.ts +16 -16
- package/dist/types/Views.d.ts +16 -16
- package/dist/types/api.d.ts +16 -16
- package/dist/types/components.d.ts +226 -39
- package/dist/types/context.d.ts +24 -16
- package/dist/types/hooks.d.ts +16 -16
- package/dist/types/index.d.ts +16 -16
- package/dist/types/util.d.ts +16 -16
- package/package.json +3 -3
- package/dist/chunks/ProjectContext.es.js +0 -158
- package/dist/chunks/useQueryArgumentChangeLoading.es.js +0 -11
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as v, useRef as B, useState as Q, useEffect as G, useMemo as h } from "react";
|
|
3
|
+
import "./searchTerms.es.js";
|
|
4
|
+
import { ca as z, c7 as E, dI as R, bO as U } from "./getUris.es.js";
|
|
5
|
+
import "primereact/confirmdialog";
|
|
6
|
+
import "lodash";
|
|
7
|
+
import "react-toastify";
|
|
8
|
+
import { g as M } from "./getEntityTypeIcon.es.js";
|
|
9
|
+
import "uuid";
|
|
10
|
+
import "axios";
|
|
11
|
+
import { P as _, n as q } from "./TableExportContextInstance.es.js";
|
|
12
|
+
const V = {
|
|
13
|
+
name: "",
|
|
14
|
+
code: "",
|
|
15
|
+
productTypes: [],
|
|
16
|
+
folderTypes: [],
|
|
17
|
+
taskTypes: [],
|
|
18
|
+
tags: [],
|
|
19
|
+
statuses: [],
|
|
20
|
+
createdAt: "",
|
|
21
|
+
updatedAt: "",
|
|
22
|
+
active: !0,
|
|
23
|
+
attrib: {},
|
|
24
|
+
data: {},
|
|
25
|
+
config: {},
|
|
26
|
+
library: !1,
|
|
27
|
+
linkTypes: [],
|
|
28
|
+
ownAttrib: []
|
|
29
|
+
};
|
|
30
|
+
function W(t) {
|
|
31
|
+
if (!t)
|
|
32
|
+
return { productTypes: [], productBaseTypes: [] };
|
|
33
|
+
const d = t.productTypes || [], n = /* @__PURE__ */ new Map();
|
|
34
|
+
return d.forEach((i) => {
|
|
35
|
+
n.has(i.baseType) || n.set(i.baseType, {
|
|
36
|
+
name: i.baseType,
|
|
37
|
+
icon: i.icon,
|
|
38
|
+
color: i.color
|
|
39
|
+
});
|
|
40
|
+
}), {
|
|
41
|
+
productTypes: d,
|
|
42
|
+
productBaseTypes: Array.from(n.values())
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const re = ({
|
|
46
|
+
projectName: t,
|
|
47
|
+
children: d
|
|
48
|
+
}) => {
|
|
49
|
+
const {
|
|
50
|
+
data: n,
|
|
51
|
+
isLoading: i,
|
|
52
|
+
isFetching: g,
|
|
53
|
+
isSuccess: p,
|
|
54
|
+
isUninitialized: T,
|
|
55
|
+
error: u,
|
|
56
|
+
refetch: A
|
|
57
|
+
} = z({ projectName: t }, { skip: !t }), { data: m = {}, refetch: f } = E(
|
|
58
|
+
{ projectName: t },
|
|
59
|
+
{ skip: !t }
|
|
60
|
+
), y = m.product_base_types?.default, { data: w } = R(
|
|
61
|
+
{ projectName: t },
|
|
62
|
+
{
|
|
63
|
+
skip: !t
|
|
64
|
+
}
|
|
65
|
+
), { productTypes: l, productBaseTypes: F } = W(w), k = v(
|
|
66
|
+
(s) => n?.folderTypes?.find((e) => e.name === s),
|
|
67
|
+
[n]
|
|
68
|
+
), C = v(
|
|
69
|
+
(s) => n?.taskTypes?.find((e) => e.name === s),
|
|
70
|
+
[n]
|
|
71
|
+
), L = v(
|
|
72
|
+
(s) => {
|
|
73
|
+
const e = l.find((c) => c.name === s);
|
|
74
|
+
return {
|
|
75
|
+
icon: e?.icon || y?.icon || M("product"),
|
|
76
|
+
color: e?.color || y?.color
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
[l, y]
|
|
80
|
+
), x = v(() => l.map((e) => ({
|
|
81
|
+
value: e.name,
|
|
82
|
+
label: e.name,
|
|
83
|
+
icon: e.icon || y?.icon || M("product"),
|
|
84
|
+
color: e.color || y?.color || ""
|
|
85
|
+
})), [l, y]), o = v(() => {
|
|
86
|
+
A(), f();
|
|
87
|
+
}, [A, f]), r = {
|
|
88
|
+
getFolderType: k,
|
|
89
|
+
getTaskType: C,
|
|
90
|
+
getProductType: L,
|
|
91
|
+
getProductTypeOptions: x,
|
|
92
|
+
refetch: o
|
|
93
|
+
};
|
|
94
|
+
return /* @__PURE__ */ O(
|
|
95
|
+
_.Provider,
|
|
96
|
+
{
|
|
97
|
+
value: {
|
|
98
|
+
...V,
|
|
99
|
+
...n,
|
|
100
|
+
projectName: t,
|
|
101
|
+
productTypes: l,
|
|
102
|
+
productBaseTypes: F,
|
|
103
|
+
anatomy: m,
|
|
104
|
+
isLoading: i || g,
|
|
105
|
+
isSuccess: p,
|
|
106
|
+
isUninitialized: T,
|
|
107
|
+
error: u,
|
|
108
|
+
...r
|
|
109
|
+
},
|
|
110
|
+
children: d
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}, D = (t, d) => {
|
|
114
|
+
const n = B(null), [i, g] = Q(!1);
|
|
115
|
+
return G(() => {
|
|
116
|
+
const p = n.current;
|
|
117
|
+
!p || Object.keys(t).some((u) => p[u] !== t[u]) || Object.keys(p).some((u) => p[u] !== t[u]) ? (n.current = { ...t }, g(d)) : d || g(!1);
|
|
118
|
+
}, [Object.values(t).join(","), d]), i;
|
|
119
|
+
}, se = ({
|
|
120
|
+
projectName: t,
|
|
121
|
+
children: d
|
|
122
|
+
}) => {
|
|
123
|
+
const {
|
|
124
|
+
data: { folders: n = [] } = {},
|
|
125
|
+
isLoading: i,
|
|
126
|
+
isFetching: g,
|
|
127
|
+
isSuccess: p,
|
|
128
|
+
isUninitialized: T,
|
|
129
|
+
error: u,
|
|
130
|
+
refetch: A
|
|
131
|
+
} = U({ projectName: t, attrib: !0 }), m = D({ projectName: t }, g || i), f = h(() => {
|
|
132
|
+
const o = /* @__PURE__ */ new Map();
|
|
133
|
+
for (const r of n)
|
|
134
|
+
o.set(r.id, r);
|
|
135
|
+
return o;
|
|
136
|
+
}, [n]), y = h(() => (o) => f.get(o), [f]), w = h(
|
|
137
|
+
() => (o, r, s = {}) => {
|
|
138
|
+
if (!r.length) return {};
|
|
139
|
+
const e = {}, c = new Set(r), b = /* @__PURE__ */ new Set();
|
|
140
|
+
let I = o;
|
|
141
|
+
for (; c.size > 0 && I && !b.has(I); ) {
|
|
142
|
+
b.add(I);
|
|
143
|
+
const a = f.get(I);
|
|
144
|
+
if (!a) break;
|
|
145
|
+
const S = a.attrib || {};
|
|
146
|
+
for (const P of Array.from(c))
|
|
147
|
+
a.ownAttrib?.includes(P) && P in S && (e[P] = Object.entries(S).find(
|
|
148
|
+
([j]) => j === P
|
|
149
|
+
)?.[1], c.delete(P));
|
|
150
|
+
I = a.parentId;
|
|
151
|
+
}
|
|
152
|
+
for (const a of Array.from(c))
|
|
153
|
+
a in s && (e[a] = s[a], c.delete(a));
|
|
154
|
+
for (const a of c)
|
|
155
|
+
e[a] = null;
|
|
156
|
+
return e;
|
|
157
|
+
},
|
|
158
|
+
[f]
|
|
159
|
+
), l = h(
|
|
160
|
+
() => (o) => {
|
|
161
|
+
const r = [], s = /* @__PURE__ */ new Set();
|
|
162
|
+
let e = o;
|
|
163
|
+
for (; e && !s.has(e); ) {
|
|
164
|
+
s.add(e);
|
|
165
|
+
const c = f.get(e);
|
|
166
|
+
if (!c?.parentId) break;
|
|
167
|
+
r.push(c.parentId), e = c.parentId;
|
|
168
|
+
}
|
|
169
|
+
return r;
|
|
170
|
+
},
|
|
171
|
+
[f]
|
|
172
|
+
), F = h(
|
|
173
|
+
() => (o) => {
|
|
174
|
+
const r = new Set(o);
|
|
175
|
+
return o.filter((s) => !l(s).some((e) => r.has(e)));
|
|
176
|
+
},
|
|
177
|
+
[l]
|
|
178
|
+
), k = h(() => {
|
|
179
|
+
const o = /* @__PURE__ */ new Map();
|
|
180
|
+
for (const r of n) {
|
|
181
|
+
if (!r.parentId) continue;
|
|
182
|
+
const s = o.get(r.parentId);
|
|
183
|
+
s ? s.push(r.id) : o.set(r.parentId, [r.id]);
|
|
184
|
+
}
|
|
185
|
+
return o;
|
|
186
|
+
}, [n]), C = h(
|
|
187
|
+
() => (o, r = !1) => {
|
|
188
|
+
const s = r ? [...o] : [], e = [...o];
|
|
189
|
+
for (; e.length > 0; ) {
|
|
190
|
+
const c = e.shift();
|
|
191
|
+
for (const b of k.get(c) || [])
|
|
192
|
+
s.push(b), e.push(b);
|
|
193
|
+
}
|
|
194
|
+
return s;
|
|
195
|
+
},
|
|
196
|
+
[k]
|
|
197
|
+
), L = () => A().unwrap(), x = h(
|
|
198
|
+
() => ({
|
|
199
|
+
projectName: t,
|
|
200
|
+
folders: n,
|
|
201
|
+
getFolderById: y,
|
|
202
|
+
findNonInheritedValues: w,
|
|
203
|
+
getParentFolderIds: l,
|
|
204
|
+
getFolderIdsWithoutChildren: F,
|
|
205
|
+
getChildFolderIds: C,
|
|
206
|
+
isLoading: m,
|
|
207
|
+
// first time and when args change
|
|
208
|
+
isFetching: g,
|
|
209
|
+
// any background fetching
|
|
210
|
+
isSuccess: p,
|
|
211
|
+
isUninitialized: T,
|
|
212
|
+
error: u,
|
|
213
|
+
refetch: L
|
|
214
|
+
}),
|
|
215
|
+
[
|
|
216
|
+
t,
|
|
217
|
+
n,
|
|
218
|
+
y,
|
|
219
|
+
w,
|
|
220
|
+
l,
|
|
221
|
+
F,
|
|
222
|
+
C,
|
|
223
|
+
m,
|
|
224
|
+
g,
|
|
225
|
+
p,
|
|
226
|
+
T,
|
|
227
|
+
u,
|
|
228
|
+
L
|
|
229
|
+
]
|
|
230
|
+
);
|
|
231
|
+
return /* @__PURE__ */ O(q.Provider, { value: x, children: d });
|
|
232
|
+
};
|
|
233
|
+
export {
|
|
234
|
+
re as P,
|
|
235
|
+
se as a,
|
|
236
|
+
D as u
|
|
237
|
+
};
|