@ynput/ayon-frontend-shared 0.5.0 → 0.6.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.
- package/dist/DetailsPanel.es.js +88 -86
- package/dist/Feed.es.js +22 -22
- package/dist/ListTable.es.js +77 -67
- package/dist/ProjectTreeTable.es.js +1164 -1150
- package/dist/Slicer.es.js +2 -2
- package/dist/Views.es.js +1 -1
- package/dist/api.es.js +331 -329
- package/dist/chunks/Actions.es.js +23 -23
- package/dist/chunks/DeleteEntitiesContext.es.js +115 -115
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/DetailsPanelContext.es.js +155 -0
- package/dist/chunks/EntityPath.es.js +20 -20
- package/dist/chunks/EntityPickerDialog.es.js +1 -1
- package/dist/chunks/EntityTooltip.es.js +12 -12
- package/dist/chunks/EntityUpdatesContext.es.js +1 -1
- package/dist/chunks/Feed.es.js +2208 -2611
- package/dist/chunks/FilterErrorActions.es.js +1 -1
- package/dist/chunks/GlobalContext.es.js +14 -14
- package/dist/chunks/Menu.es.js +1 -1
- package/dist/chunks/MenuContext.es.js +51 -242
- package/dist/chunks/MenuItem.es.js +1 -1
- package/dist/chunks/MetaWidget.es.js +3341 -3899
- package/dist/chunks/NewEntityContext.es.js +40 -40
- package/dist/chunks/PlayableIcon.es.js +4261 -1163
- package/dist/chunks/ProjectContext.es.js +13 -13
- package/dist/chunks/ProjectFoldersContext.es.js +5 -5
- package/dist/chunks/RepresentationsList.es.js +3 -3
- package/dist/chunks/ReviewablesSelector.es.js +85 -76
- package/dist/chunks/SimpleForm.es.js +9 -9
- package/dist/chunks/SimpleTable.es.js +1 -1
- package/dist/chunks/Slicer.es.js +173 -171
- package/dist/chunks/TableSettingsFallback.es.js +6 -6
- package/dist/chunks/ThumbnailSimple.es.js +410 -61
- package/dist/chunks/VersionUploadContext.es.js +29 -29
- package/dist/chunks/ViewsContext.es.js +90 -90
- package/dist/chunks/Watchers.es.js +628 -598
- package/dist/chunks/entityDefinitions.es.js +31 -31
- package/dist/chunks/expandRelativeDates.es.js +27 -0
- package/dist/chunks/getBundleMode.es.js +16 -61
- package/dist/chunks/getUris.es.js +271 -269
- package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
- package/dist/chunks/searchTerms.es.js +177 -173
- package/dist/chunks/uriUtils.es.js +48 -0
- package/dist/chunks/useAttributeEnums.es.js +11 -11
- package/dist/chunks/useColumnDragRestriction.es.js +37 -27
- package/dist/chunks/useDateRangeFilter.es.js +3 -3
- package/dist/chunks/useLocalStorage.es.js +9 -9
- package/dist/chunks/useSessionStorage.es.js +61 -0
- package/dist/chunks/viewUpdateHelper.es.js +19 -19
- package/dist/components.es.js +165 -160
- package/dist/context.es.js +60 -58
- package/dist/hooks.es.js +104 -98
- package/dist/index.es.js +18 -13
- 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 +16 -16
- 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 +20 -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 +17 -17
- package/dist/types/api.d.ts +391 -95
- package/dist/types/components.d.ts +79 -20
- package/dist/types/context.d.ts +60 -17
- 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/dist/util.es.js +108 -97
- package/package.json +16 -4
- package/dist/chunks/mentionTypeOptions.es.js +0 -15
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import X, { useState as x, useMemo as U, createContext as $, useContext as F, useCallback as M, useEffect as A, useRef as G } from "react";
|
|
2
2
|
import { jsxs as I, jsx as c, Fragment as Z } from "react/jsx-runtime";
|
|
3
3
|
import { a as fe } from "./useCreateContextMenu.es.js";
|
|
4
|
-
import { v4 as
|
|
4
|
+
import { v4 as Q } from "uuid";
|
|
5
5
|
import { createPortal as he } from "react-dom";
|
|
6
6
|
import { Dialog as me } from "primereact/dialog";
|
|
7
|
-
import { Dialog as ge, InputText as re, Button as
|
|
7
|
+
import { Dialog as ge, InputText as re, Button as z } from "@ynput/ayon-react-components";
|
|
8
8
|
import v from "styled-components";
|
|
9
|
-
import {
|
|
9
|
+
import { c2 as we, cL as ye, dl as Ce, cI as xe } from "./getUris.es.js";
|
|
10
10
|
import { u as ve } from "./GlobalContext.es.js";
|
|
11
11
|
import { toast as O } from "react-toastify";
|
|
12
12
|
import { debounce as ee, isEqual as be } from "lodash";
|
|
13
13
|
import "primereact/confirmdialog";
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
14
|
+
import { bf as _, a as Pe, ay as Ee, be as Se } from "./searchTerms.es.js";
|
|
15
|
+
import Te, { ReadyState as ke } from "react-use-websocket";
|
|
16
16
|
import { p as j } from "./pluralize.es.js";
|
|
17
|
-
const
|
|
17
|
+
const J = [
|
|
18
18
|
"folder",
|
|
19
19
|
"task",
|
|
20
20
|
"product",
|
|
21
21
|
"version",
|
|
22
22
|
"representation",
|
|
23
23
|
"workfile"
|
|
24
|
-
], te = 1,
|
|
24
|
+
], te = 1, De = (e) => e.length <= 1 ? e.join("") : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`, Ie = (e) => {
|
|
25
25
|
if (e.length === 1) {
|
|
26
26
|
const t = e[0];
|
|
27
27
|
return `${t.entityType} "${t.label || t.name || t.id}"`;
|
|
28
28
|
}
|
|
29
29
|
const s = {};
|
|
30
30
|
for (const t of e) s[t.entityType] = (s[t.entityType] || 0) + 1;
|
|
31
|
-
const i =
|
|
31
|
+
const i = J.filter((t) => s[t] > 0).map(
|
|
32
32
|
(t) => j(s[t], t)
|
|
33
33
|
);
|
|
34
|
-
return
|
|
35
|
-
},
|
|
34
|
+
return De(i);
|
|
35
|
+
}, Re = (e, s) => {
|
|
36
36
|
const i = {}, t = (o, n) => {
|
|
37
37
|
n > 0 && (i[o] = (i[o] || 0) + n);
|
|
38
38
|
};
|
|
@@ -40,7 +40,7 @@ const Y = [
|
|
|
40
40
|
for (const o of s)
|
|
41
41
|
t("folder", o.totalFolderCount), t("task", o.totalTaskCount), t("product", o.totalProductCount), t("version", o.totalVersionCount);
|
|
42
42
|
return i;
|
|
43
|
-
},
|
|
43
|
+
}, $e = (e) => J.reduce((s, i) => s + (e[i] || 0), 0), Y = 8, Le = (e, s) => {
|
|
44
44
|
if (e.length === 0) return [];
|
|
45
45
|
const i = new Map(s.map((n) => [n.id, n])), t = e.length > 1, o = [];
|
|
46
46
|
for (const n of e) {
|
|
@@ -51,49 +51,49 @@ const Y = [
|
|
|
51
51
|
} else
|
|
52
52
|
n.hasChildren && o.push(`${m}child folders`), n.taskNames && n.taskNames.length > 0 && o.push(`${m}${j(n.taskNames.length, "task")}`);
|
|
53
53
|
}
|
|
54
|
-
return o.length >
|
|
55
|
-
...o.slice(0,
|
|
56
|
-
`…and ${o.length -
|
|
54
|
+
return o.length > Y ? [
|
|
55
|
+
...o.slice(0, Y),
|
|
56
|
+
`…and ${o.length - Y} more`
|
|
57
57
|
] : o;
|
|
58
|
-
},
|
|
58
|
+
}, Oe = v.div`
|
|
59
59
|
min-width: 350px;
|
|
60
|
-
`,
|
|
60
|
+
`, Fe = v.div`
|
|
61
61
|
margin-top: 12px;
|
|
62
62
|
min-height: 60px;
|
|
63
63
|
min-width: 350px;
|
|
64
|
-
`,
|
|
64
|
+
`, Ne = v.p`
|
|
65
65
|
font-weight: 600;
|
|
66
66
|
margin-bottom: 4px;
|
|
67
|
-
`,
|
|
67
|
+
`, Ae = v.p`
|
|
68
68
|
margin-top: 12px;
|
|
69
69
|
font-weight: 600;
|
|
70
70
|
color: var(--md-sys-color-error);
|
|
71
|
-
`,
|
|
71
|
+
`, je = ({
|
|
72
72
|
entityLabel: e,
|
|
73
73
|
childrenDetails: s,
|
|
74
74
|
totalLine: i,
|
|
75
75
|
message: t
|
|
76
|
-
}) => /* @__PURE__ */ I(
|
|
76
|
+
}) => /* @__PURE__ */ I(Oe, { children: [
|
|
77
77
|
/* @__PURE__ */ c("p", { children: t || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
|
|
78
|
-
s.length > 0 && /* @__PURE__ */ I(
|
|
79
|
-
/* @__PURE__ */ c(
|
|
78
|
+
s.length > 0 && /* @__PURE__ */ I(Fe, { children: [
|
|
79
|
+
/* @__PURE__ */ c(Ne, { children: "The following will also be affected:" }),
|
|
80
80
|
s.map((o, n) => /* @__PURE__ */ c("p", { children: o }, n))
|
|
81
81
|
] }),
|
|
82
|
-
i && /* @__PURE__ */ c(
|
|
83
|
-
] }),
|
|
82
|
+
i && /* @__PURE__ */ c(Ae, { children: i })
|
|
83
|
+
] }), Me = v(ge)`
|
|
84
84
|
max-height: min(600px, 90vh);
|
|
85
|
-
`,
|
|
85
|
+
`, We = v.div`
|
|
86
86
|
display: flex;
|
|
87
87
|
flex-direction: column;
|
|
88
88
|
width: 100%;
|
|
89
89
|
`, oe = v.label`
|
|
90
90
|
margin: 2px 0 14px 0;
|
|
91
|
-
`,
|
|
91
|
+
`, _e = v.div`
|
|
92
92
|
display: flex;
|
|
93
93
|
padding-top: 14px;
|
|
94
94
|
gap: 8px;
|
|
95
95
|
justify-content: flex-end;
|
|
96
|
-
`,
|
|
96
|
+
`, Ue = v.div`
|
|
97
97
|
display: flex;
|
|
98
98
|
flex-direction: column;
|
|
99
99
|
gap: 8px;
|
|
@@ -102,18 +102,18 @@ const Y = [
|
|
|
102
102
|
/* scroll container clips the inputs' 2px focus outline — inset it, then pull back to keep alignment */
|
|
103
103
|
padding: 4px;
|
|
104
104
|
margin: -4px;
|
|
105
|
-
`,
|
|
105
|
+
`, qe = v.label`
|
|
106
106
|
display: flex;
|
|
107
107
|
align-items: center;
|
|
108
108
|
justify-content: space-between;
|
|
109
109
|
gap: 12px;
|
|
110
|
-
`, qe = v(re)`
|
|
111
|
-
width: 180px;
|
|
112
110
|
`, Ve = v(re)`
|
|
111
|
+
width: 180px;
|
|
112
|
+
`, ze = v(re)`
|
|
113
113
|
width: 100%;
|
|
114
114
|
/* room for the 2px focus outline */
|
|
115
115
|
margin: 2px 0;
|
|
116
|
-
`,
|
|
116
|
+
`, Be = (e, s) => {
|
|
117
117
|
const i = (e ?? "").trim();
|
|
118
118
|
return i !== "" && Number(i) === s;
|
|
119
119
|
}, ne = ({
|
|
@@ -129,13 +129,13 @@ const Y = [
|
|
|
129
129
|
deleteLabel: y = "Delete forever",
|
|
130
130
|
message: m
|
|
131
131
|
} = e, [C, u] = x(""), [p, a] = x({}), g = U(
|
|
132
|
-
() =>
|
|
132
|
+
() => J.filter((d) => (n[d] || 0) > 0),
|
|
133
133
|
[n]
|
|
134
|
-
), f = U(() =>
|
|
134
|
+
), f = U(() => $e(n), [n]), b = f > te, h = !!r && !b, S = b ? g.every((d) => Be(p[d], n[d])) : h ? C.trim() === r : !0, T = (d) => {
|
|
135
135
|
d.key === "Enter" && S && (d.preventDefault(), s());
|
|
136
136
|
};
|
|
137
137
|
return /* @__PURE__ */ c(
|
|
138
|
-
|
|
138
|
+
Me,
|
|
139
139
|
{
|
|
140
140
|
size: "md",
|
|
141
141
|
isOpen: !0,
|
|
@@ -144,7 +144,7 @@ const Y = [
|
|
|
144
144
|
footer: (
|
|
145
145
|
// keydown lives here, not on the dialog — dialog spreads rest props over its own
|
|
146
146
|
// handler and would lose escape-to-close
|
|
147
|
-
/* @__PURE__ */ I(
|
|
147
|
+
/* @__PURE__ */ I(We, { onKeyDown: T, children: [
|
|
148
148
|
h && /* @__PURE__ */ I(Z, { children: [
|
|
149
149
|
/* @__PURE__ */ I(oe, { htmlFor: "delete-confirm-name-input", children: [
|
|
150
150
|
"To confirm delete action, type '",
|
|
@@ -152,7 +152,7 @@ const Y = [
|
|
|
152
152
|
"' in the box below"
|
|
153
153
|
] }),
|
|
154
154
|
/* @__PURE__ */ c(
|
|
155
|
-
|
|
155
|
+
ze,
|
|
156
156
|
{
|
|
157
157
|
id: "delete-confirm-name-input",
|
|
158
158
|
"data-testid": "delete-confirm-name-input",
|
|
@@ -165,10 +165,10 @@ const Y = [
|
|
|
165
165
|
] }),
|
|
166
166
|
b && /* @__PURE__ */ I(Z, { children: [
|
|
167
167
|
/* @__PURE__ */ c(oe, { as: "p", children: "To confirm, type how many of each will be deleted, children included" }),
|
|
168
|
-
/* @__PURE__ */ c(
|
|
168
|
+
/* @__PURE__ */ c(Ue, { children: g.map((d, P) => /* @__PURE__ */ I(qe, { children: [
|
|
169
169
|
/* @__PURE__ */ c("span", { children: `${d[0].toUpperCase()}${d.slice(1)}s - ${n[d]}` }),
|
|
170
170
|
/* @__PURE__ */ c(
|
|
171
|
-
|
|
171
|
+
Ve,
|
|
172
172
|
{
|
|
173
173
|
"data-testid": `delete-confirm-count-${d}`,
|
|
174
174
|
autoFocus: P === 0,
|
|
@@ -180,10 +180,10 @@ const Y = [
|
|
|
180
180
|
)
|
|
181
181
|
] }, d)) })
|
|
182
182
|
] }),
|
|
183
|
-
/* @__PURE__ */ I(
|
|
184
|
-
/* @__PURE__ */ c(
|
|
183
|
+
/* @__PURE__ */ I(_e, { children: [
|
|
184
|
+
/* @__PURE__ */ c(z, { label: "Cancel", onClick: i }),
|
|
185
185
|
/* @__PURE__ */ c(
|
|
186
|
-
|
|
186
|
+
z,
|
|
187
187
|
{
|
|
188
188
|
"data-testid": "delete-confirm-submit",
|
|
189
189
|
variant: "danger",
|
|
@@ -196,7 +196,7 @@ const Y = [
|
|
|
196
196
|
] })
|
|
197
197
|
),
|
|
198
198
|
children: /* @__PURE__ */ c(
|
|
199
|
-
|
|
199
|
+
je,
|
|
200
200
|
{
|
|
201
201
|
entityLabel: t,
|
|
202
202
|
childrenDetails: o,
|
|
@@ -209,9 +209,9 @@ const Y = [
|
|
|
209
209
|
)
|
|
210
210
|
}
|
|
211
211
|
);
|
|
212
|
-
},
|
|
212
|
+
}, wt = $(
|
|
213
213
|
void 0
|
|
214
|
-
), ie = $({}),
|
|
214
|
+
), ie = $({}), yt = ({
|
|
215
215
|
children: e,
|
|
216
216
|
thumbnailInputRef: s,
|
|
217
217
|
versionsInputRef: i,
|
|
@@ -251,12 +251,12 @@ const Y = [
|
|
|
251
251
|
children: e
|
|
252
252
|
}
|
|
253
253
|
);
|
|
254
|
-
},
|
|
254
|
+
}, Ct = () => {
|
|
255
255
|
const e = ie;
|
|
256
256
|
if (!e)
|
|
257
257
|
throw new Error("useThumbnailUploadContext must be used within a ThumbnailUploadProvider");
|
|
258
258
|
return e;
|
|
259
|
-
}, le = $(void 0),
|
|
259
|
+
}, le = $(void 0), xt = ({ children: e }) => {
|
|
260
260
|
const [s, i] = x(!1), [t, o] = x(null), [n, r] = x(null), y = () => {
|
|
261
261
|
i(!0), o(null);
|
|
262
262
|
}, m = () => {
|
|
@@ -285,23 +285,23 @@ const Y = [
|
|
|
285
285
|
children: e
|
|
286
286
|
}
|
|
287
287
|
);
|
|
288
|
-
},
|
|
288
|
+
}, vt = () => {
|
|
289
289
|
const e = F(le);
|
|
290
290
|
if (e === void 0)
|
|
291
291
|
throw new Error("useSettingsPanel must be used within a SettingsPanelProvider");
|
|
292
292
|
return e;
|
|
293
293
|
}, ae = $(void 0);
|
|
294
|
-
function
|
|
294
|
+
function bt({ children: e }) {
|
|
295
295
|
const s = window.location.protocol === "https:" || window.location.hostname === "localhost", i = "documentPictureInPicture" in window && s, [t, o] = x(null), [n, r] = x(null), y = M(() => {
|
|
296
296
|
r(null), t != null && (t.close(), o(null));
|
|
297
297
|
}, [t, n]), m = M(
|
|
298
298
|
async (u, p) => {
|
|
299
299
|
if (!i) {
|
|
300
|
-
r(
|
|
300
|
+
r(Q());
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
303
|
if (t != null) {
|
|
304
|
-
console.log("pipWindow is already open"), r(
|
|
304
|
+
console.log("pipWindow is already open"), r(Q());
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
307
|
const a = await window.documentPictureInPicture.requestWindow({
|
|
@@ -310,7 +310,7 @@ function vt({ children: e }) {
|
|
|
310
310
|
});
|
|
311
311
|
a.addEventListener("pagehide", () => {
|
|
312
312
|
o(null), r(null);
|
|
313
|
-
}), o(a), r(
|
|
313
|
+
}), o(a), r(Q());
|
|
314
314
|
},
|
|
315
315
|
[t, n]
|
|
316
316
|
);
|
|
@@ -344,16 +344,16 @@ function vt({ children: e }) {
|
|
|
344
344
|
}), [y, i, t, m]);
|
|
345
345
|
return /* @__PURE__ */ c(ae.Provider, { value: C, children: e });
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function He() {
|
|
348
348
|
const e = F(ae);
|
|
349
349
|
if (e === void 0)
|
|
350
350
|
throw new Error("usePiPWindow must be used within a PiPContext");
|
|
351
351
|
return e;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Ge({ pipWindow: e, children: s }) {
|
|
354
354
|
return he(s, e.document.body);
|
|
355
355
|
}
|
|
356
|
-
const
|
|
356
|
+
const Qe = v(me)`
|
|
357
357
|
width: 25vw;
|
|
358
358
|
height: 70vh;
|
|
359
359
|
border: solid 1px var(--md-sys-color-outline-variant);
|
|
@@ -366,7 +366,7 @@ const Ge = v(me)`
|
|
|
366
366
|
opacity: 1;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
`,
|
|
369
|
+
`, Ye = v(z)`
|
|
370
370
|
width: 26px;
|
|
371
371
|
height: 26px;
|
|
372
372
|
margin-left: auto;
|
|
@@ -382,12 +382,12 @@ const Ge = v(me)`
|
|
|
382
382
|
&:hover {
|
|
383
383
|
background-color: #3d3e40;
|
|
384
384
|
}
|
|
385
|
-
`,
|
|
386
|
-
const { pipWindow: s, pipId: i, isSupported: t, closePipWindow: o } =
|
|
385
|
+
`, Pt = ({ children: e }) => {
|
|
386
|
+
const { pipWindow: s, pipId: i, isSupported: t, closePipWindow: o } = He(), n = i && X.isValidElement(e) ? X.cloneElement(e, { id: i }) : e;
|
|
387
387
|
return !t && i ? /* @__PURE__ */ c(
|
|
388
|
-
|
|
388
|
+
Qe,
|
|
389
389
|
{
|
|
390
|
-
header: /* @__PURE__ */ c(
|
|
390
|
+
header: /* @__PURE__ */ c(Ye, { icon: "close", className: "close", onClick: o }),
|
|
391
391
|
headerStyle: {
|
|
392
392
|
padding: 4,
|
|
393
393
|
backgroundColor: "#202124",
|
|
@@ -410,8 +410,8 @@ const Ge = v(me)`
|
|
|
410
410
|
position: "right",
|
|
411
411
|
children: n
|
|
412
412
|
}
|
|
413
|
-
) : s && /* @__PURE__ */ c(
|
|
414
|
-
}, ce = $(void 0),
|
|
413
|
+
) : s && /* @__PURE__ */ c(Ge, { pipWindow: s, children: /* @__PURE__ */ c("div", { className: "pipRoot", children: n }) });
|
|
414
|
+
}, ce = $(void 0), Et = ({
|
|
415
415
|
children: e,
|
|
416
416
|
projectName: s,
|
|
417
417
|
// utils
|
|
@@ -435,20 +435,20 @@ const Ge = v(me)`
|
|
|
435
435
|
children: e
|
|
436
436
|
}
|
|
437
437
|
);
|
|
438
|
-
},
|
|
438
|
+
}, St = () => {
|
|
439
439
|
const e = F(ce);
|
|
440
440
|
if (!e)
|
|
441
441
|
throw new Error("useAddonProjectContext must be used within a AddonProjectContext");
|
|
442
442
|
return e;
|
|
443
|
-
}, de = $(void 0),
|
|
443
|
+
}, de = $(void 0), Tt = ({ children: e, ...s }) => /* @__PURE__ */ c(de.Provider, { value: { ...s }, children: e }), kt = () => {
|
|
444
444
|
const e = F(de);
|
|
445
445
|
if (!e)
|
|
446
446
|
throw new Error("useAddonContext must be used within a AddonContext");
|
|
447
447
|
return e;
|
|
448
|
-
},
|
|
448
|
+
}, Je = () => /* @__PURE__ */ I("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
449
449
|
"Refresh to see latest changes.",
|
|
450
|
-
/* @__PURE__ */ c(
|
|
451
|
-
] }), ue = $(void 0),
|
|
450
|
+
/* @__PURE__ */ c(z, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
|
|
451
|
+
] }), ue = $(void 0), Ke = window.location.protocol.replace("http", "ws"), Xe = `${Ke}//${window.location.host}/ws`, Dt = ({
|
|
452
452
|
children: e,
|
|
453
453
|
userName: s,
|
|
454
454
|
projectName: i,
|
|
@@ -460,8 +460,8 @@ const Ge = v(me)`
|
|
|
460
460
|
}, [o]);
|
|
461
461
|
const u = {
|
|
462
462
|
shouldReconnect: () => !s || !localStorage.getItem("accessToken") ? !1 : (m({ full: !1 }).unwrap(), !0)
|
|
463
|
-
}, { sendMessage: p, readyState: a, getWebSocket: g } =
|
|
464
|
-
|
|
463
|
+
}, { sendMessage: p, readyState: a, getWebSocket: g } = Te(
|
|
464
|
+
Xe,
|
|
465
465
|
u,
|
|
466
466
|
!!s
|
|
467
467
|
), f = () => {
|
|
@@ -490,7 +490,7 @@ const Ge = v(me)`
|
|
|
490
490
|
}), [h]);
|
|
491
491
|
const [S, T] = x(!1), [d, P] = x(!1);
|
|
492
492
|
A(() => {
|
|
493
|
-
S && !d && (O.warning(/* @__PURE__ */ c(
|
|
493
|
+
S && !d && (O.warning(/* @__PURE__ */ c(Je, {}), {
|
|
494
494
|
autoClose: !1,
|
|
495
495
|
closeButton: !1
|
|
496
496
|
}), P(!0));
|
|
@@ -506,8 +506,8 @@ const Ge = v(me)`
|
|
|
506
506
|
let l;
|
|
507
507
|
try {
|
|
508
508
|
l = JSON.parse(E.data);
|
|
509
|
-
} catch (
|
|
510
|
-
console.error("Failed to parse websocket message:",
|
|
509
|
+
} catch (H) {
|
|
510
|
+
console.error("Failed to parse websocket message:", H, E.data);
|
|
511
511
|
return;
|
|
512
512
|
}
|
|
513
513
|
const { topic: w, sender: D, summary: R, status: L } = l || {};
|
|
@@ -520,13 +520,13 @@ const Ge = v(me)`
|
|
|
520
520
|
if (D !== window.senderId) return;
|
|
521
521
|
} else if (D === window.senderId)
|
|
522
522
|
return;
|
|
523
|
-
const
|
|
524
|
-
|
|
523
|
+
const B = Date.now();
|
|
524
|
+
B - k.current.lastCall < 1e3 ? k.current.callCount += 1 : k.current.callCount = 0, console.log("Event RX", l), k.current.lastCall = B, w === "shout" && l?.summary?.text && O.info(R.text), _.publish(w, l);
|
|
525
525
|
},
|
|
526
526
|
[n]
|
|
527
527
|
);
|
|
528
528
|
return A(() => {
|
|
529
|
-
a ===
|
|
529
|
+
a === ke.OPEN && (g().onmessage = q, f(), _.publish("client.connected", {
|
|
530
530
|
topic: "client.connected"
|
|
531
531
|
}));
|
|
532
532
|
}, [a, g]), /* @__PURE__ */ c(
|
|
@@ -540,26 +540,26 @@ const Ge = v(me)`
|
|
|
540
540
|
children: e
|
|
541
541
|
}
|
|
542
542
|
);
|
|
543
|
-
},
|
|
543
|
+
}, It = () => {
|
|
544
544
|
const e = F(ue);
|
|
545
545
|
if (e === void 0)
|
|
546
546
|
throw new Error("useSocketContext must be used within a SocketProvider");
|
|
547
547
|
return e;
|
|
548
|
-
},
|
|
548
|
+
}, Rt = $(void 0), Ze = /* @__PURE__ */ new Set([
|
|
549
549
|
"folder",
|
|
550
550
|
"task",
|
|
551
551
|
"product",
|
|
552
552
|
"version",
|
|
553
553
|
"representation",
|
|
554
554
|
"workfile"
|
|
555
|
-
]),
|
|
555
|
+
]), $t = (e) => !!e && Ze.has(e), K = $(null), se = [
|
|
556
556
|
"representation",
|
|
557
557
|
"version",
|
|
558
558
|
"workfile",
|
|
559
559
|
"product",
|
|
560
560
|
"task",
|
|
561
561
|
"folder"
|
|
562
|
-
],
|
|
562
|
+
], et = "delete-folder-with-children", Lt = ({ children: e }) => {
|
|
563
563
|
const [s] = Ce(), [i] = xe(), [t, o] = x(null), [n, r] = x(null), y = M(
|
|
564
564
|
(p) => new Promise((a) => r({ payload: p, resolve: a })),
|
|
565
565
|
[]
|
|
@@ -583,7 +583,7 @@ const Ge = v(me)`
|
|
|
583
583
|
}
|
|
584
584
|
await Promise.all(
|
|
585
585
|
Array.from(D.entries()).map(([R, L]) => {
|
|
586
|
-
const
|
|
586
|
+
const H = [...L].sort(
|
|
587
587
|
(V, pe) => se.indexOf(V.entityType) - se.indexOf(pe.entityType)
|
|
588
588
|
).map((V) => ({
|
|
589
589
|
type: "delete",
|
|
@@ -592,7 +592,7 @@ const Ge = v(me)`
|
|
|
592
592
|
force: w
|
|
593
593
|
}));
|
|
594
594
|
return s({
|
|
595
|
-
operationsRequestModel: { operations:
|
|
595
|
+
operationsRequestModel: { operations: H },
|
|
596
596
|
projectName: R
|
|
597
597
|
}).unwrap();
|
|
598
598
|
})
|
|
@@ -601,7 +601,7 @@ const Ge = v(me)`
|
|
|
601
601
|
try {
|
|
602
602
|
await S(h, !1), a?.onSuccess?.();
|
|
603
603
|
} catch (l) {
|
|
604
|
-
throw { message:
|
|
604
|
+
throw { message: Se(l) || "Failed to delete entities", ...l };
|
|
605
605
|
}
|
|
606
606
|
}, d = () => S(
|
|
607
607
|
h.filter((l) => l.entityType === "folder" || l.entityType === "task"),
|
|
@@ -627,20 +627,20 @@ const Ge = v(me)`
|
|
|
627
627
|
console.warn("Failed to fetch folder delete info, falling back to local data", w);
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
const N =
|
|
630
|
+
const N = Le(P, k), q = h.filter((l) => l.entityType === "product").length;
|
|
631
631
|
q > 0 && N.push(
|
|
632
632
|
q > 1 ? "Deleting these products also deletes all their versions" : "Deleting this product also deletes all its versions"
|
|
633
633
|
);
|
|
634
|
-
const E =
|
|
634
|
+
const E = Ie(h), W = h.length === 1 ? h[0] : void 0;
|
|
635
635
|
o({
|
|
636
636
|
payload: {
|
|
637
637
|
entityLabel: E,
|
|
638
638
|
childrenDetails: N,
|
|
639
|
-
expectedCounts:
|
|
639
|
+
expectedCounts: Re(h, k),
|
|
640
640
|
expectedName: W && (W.label || W.name || W.id)
|
|
641
641
|
},
|
|
642
642
|
accept: T,
|
|
643
|
-
recover: async (l) => l
|
|
643
|
+
recover: async (l) => Ee(l).includes(et) ? await y({
|
|
644
644
|
entityLabel: E,
|
|
645
645
|
message: `Are you really sure you want to delete ${E} and all of its dependencies? This cannot be undone. (NOT RECOMMENDED)`,
|
|
646
646
|
childrenDetails: [],
|
|
@@ -686,7 +686,7 @@ const Ge = v(me)`
|
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
}, [t]), u = U(() => ({ deleteEntities: m }), [m]);
|
|
689
|
-
return /* @__PURE__ */ I(
|
|
689
|
+
return /* @__PURE__ */ I(K.Provider, { value: u, children: [
|
|
690
690
|
e,
|
|
691
691
|
t && /* @__PURE__ */ c(
|
|
692
692
|
ne,
|
|
@@ -709,40 +709,40 @@ const Ge = v(me)`
|
|
|
709
709
|
}
|
|
710
710
|
)
|
|
711
711
|
] });
|
|
712
|
-
},
|
|
713
|
-
const e = F(
|
|
712
|
+
}, Ot = () => {
|
|
713
|
+
const e = F(K);
|
|
714
714
|
if (!e)
|
|
715
715
|
throw new Error("useDeleteEntitiesContext must be used within a DeleteEntitiesProvider");
|
|
716
716
|
return e;
|
|
717
|
-
},
|
|
717
|
+
}, Ft = () => F(K);
|
|
718
718
|
export {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
719
|
+
Et as A,
|
|
720
|
+
Lt as D,
|
|
721
|
+
Rt as E,
|
|
722
|
+
bt as P,
|
|
723
|
+
Je as R,
|
|
724
|
+
wt as S,
|
|
725
725
|
ie as T,
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
726
|
+
Tt as a,
|
|
727
|
+
Pt as b,
|
|
728
|
+
xt as c,
|
|
729
|
+
Dt as d,
|
|
730
|
+
yt as e,
|
|
731
|
+
St as f,
|
|
732
|
+
Ot as g,
|
|
733
|
+
Ft as h,
|
|
734
|
+
$t as i,
|
|
735
|
+
He as j,
|
|
736
|
+
vt as k,
|
|
737
|
+
It as l,
|
|
738
|
+
Ct as m,
|
|
739
739
|
te as n,
|
|
740
|
-
|
|
741
|
-
|
|
740
|
+
J as o,
|
|
741
|
+
je as p,
|
|
742
742
|
ne as q,
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
743
|
+
Le as r,
|
|
744
|
+
Ie as s,
|
|
745
|
+
Re as t,
|
|
746
|
+
kt as u,
|
|
747
|
+
$e as v
|
|
748
748
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { toast as d } from "react-toastify";
|
|
3
3
|
import "./searchTerms.es.js";
|
|
4
|
-
import {
|
|
4
|
+
import { bB as p } from "./getUris.es.js";
|
|
5
5
|
import "primereact/confirmdialog";
|
|
6
6
|
import { Dialog as f } from "@ynput/ayon-react-components";
|
|
7
7
|
import { J as u } from "./JsonViewer.es.js";
|
|
8
|
-
const
|
|
8
|
+
const A = ({
|
|
9
9
|
projectName: s,
|
|
10
10
|
entityType: e,
|
|
11
11
|
entityIds: l,
|
|
@@ -34,5 +34,5 @@ const x = ({
|
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
A as D
|
|
38
38
|
};
|