@ynput/ayon-frontend-shared 0.6.1 → 0.6.3
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 +749 -737
- package/dist/NewEntity.es.js +427 -425
- package/dist/ProjectTreeTable.es.js +1524 -1522
- package/dist/chunks/Feed.es.js +1889 -1826
- package/dist/chunks/MetaWidget.es.js +86 -99
- package/dist/chunks/Slicer.es.js +441 -434
- package/dist/chunks/Watchers.es.js +871 -810
- package/dist/chunks/searchTerms.es.js +5 -4
- package/dist/components.es.js +1 -1
- package/dist/context.es.js +255 -255
- package/dist/types/Actions.d.ts +14 -14
- package/dist/types/ContextMenu.d.ts +14 -14
- package/dist/types/DetailsPanel.d.ts +16 -14
- package/dist/types/EntityPickerDialog.d.ts +14 -14
- package/dist/types/Feed.d.ts +16 -15
- package/dist/types/ListTable.d.ts +14 -14
- package/dist/types/NewEntity.d.ts +16 -15
- package/dist/types/ProjectTreeTable.d.ts +14 -14
- package/dist/types/RepresentationsList.d.ts +14 -14
- package/dist/types/SimpleTable.d.ts +14 -14
- package/dist/types/Slicer.d.ts +14 -14
- package/dist/types/Views.d.ts +14 -14
- package/dist/types/api.d.ts +14 -14
- package/dist/types/components.d.ts +14 -14
- package/dist/types/context.d.ts +14 -14
- package/dist/types/hooks.d.ts +14 -14
- package/dist/types/index.d.ts +14 -14
- package/dist/types/util.d.ts +16 -14
- package/dist/util.es.js +61 -60
- package/package.json +1 -1
package/dist/context.es.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { registerRemotes as
|
|
4
|
-
import { ay as
|
|
5
|
-
import { cQ as
|
|
1
|
+
import { jsx as j, jsxs as pe } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as B, useCallback as E, useRef as fe, useMemo as T } from "react";
|
|
3
|
+
import { registerRemotes as ge } from "@module-federation/enhanced/runtime";
|
|
4
|
+
import { ay as me, bi as he } from "./chunks/searchTerms.es.js";
|
|
5
|
+
import { cQ as ye, c2 as Pe, cg as ve, bp as be, cS as we, cB as Ce, bJ as Se, cY as Ie, dl as ke, cI as Le } from "./chunks/getUris.es.js";
|
|
6
6
|
import "primereact/confirmdialog";
|
|
7
|
-
import { d as
|
|
8
|
-
import { E as
|
|
7
|
+
import { d as re, z as xe, a as ie, q as Ee, A as De, B as Fe, G as je, H as Te, I as Me, J as Oe, K as Re, L as Ae, N as Ue, O as Ne, Q as Be, U as Ge, V as _e, W as $e } from "./chunks/DeleteEntitiesContextInstance.es.js";
|
|
8
|
+
import { E as Ft, M as jt, X as Tt, P as Mt, Y as Ot, Z as Rt, T as At, _ as Ut, $ as Nt, g as Bt, a0 as Gt, m as _t, c as $t, a1 as Qt, t as Wt, a2 as qt, a3 as zt, a4 as Vt, a5 as Ht, a6 as Yt, v as Jt, u as Kt, n as Xt, a7 as Zt, x as en, y as tn, b as nn, a8 as on, a9 as sn, aa as rn, ab as an, ac as ln, ad as cn } from "./chunks/DeleteEntitiesContextInstance.es.js";
|
|
9
9
|
import "lodash";
|
|
10
10
|
import { toast as G } from "react-toastify";
|
|
11
|
-
import { v4 as
|
|
12
|
-
import { g as
|
|
13
|
-
import { u as
|
|
14
|
-
import { P as
|
|
11
|
+
import { v4 as K } from "uuid";
|
|
12
|
+
import { g as Qe, p as We, b as qe } from "./chunks/getBundleMode.es.js";
|
|
13
|
+
import { u as ae } from "./chunks/useLoadModule.es.js";
|
|
14
|
+
import { P as un, T as pn } from "./chunks/ProjectContext.es.js";
|
|
15
15
|
import "react-dom";
|
|
16
|
-
import { p as
|
|
17
|
-
import { a as
|
|
18
|
-
import { M as
|
|
19
|
-
import { u as
|
|
20
|
-
import { E as
|
|
21
|
-
const
|
|
22
|
-
const { data: s = [], isLoading: e } =
|
|
16
|
+
import { p as ze, c as Ve, d as He, e as Ye, b as oe } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
|
|
17
|
+
import { a as gn } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
|
|
18
|
+
import { M as hn } from "./chunks/MenuContext.es.js";
|
|
19
|
+
import { u as Je } from "./chunks/useQueryArgumentChangeLoading.es.js";
|
|
20
|
+
import { E as Pn, F as vn } from "./chunks/EntityUpdatesContext.es.js";
|
|
21
|
+
const mt = ({ children: f, skip: i }) => {
|
|
22
|
+
const { data: s = [], isLoading: e } = ye(void 0, {
|
|
23
23
|
skip: i
|
|
24
24
|
}), {
|
|
25
25
|
siteInfo: r,
|
|
26
26
|
isLoading: { siteInfo: c }
|
|
27
|
-
} =
|
|
27
|
+
} = re(), [d, h] = b(!1);
|
|
28
28
|
return B(() => {
|
|
29
29
|
if (e || c || d) return;
|
|
30
30
|
if (!s.length) {
|
|
@@ -42,7 +42,7 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
42
42
|
modules: m
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
-
}),
|
|
45
|
+
}), ge(
|
|
46
46
|
y.map((g) => ({
|
|
47
47
|
name: g.remote,
|
|
48
48
|
alias: g.remote,
|
|
@@ -50,8 +50,8 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
50
50
|
type: "module"
|
|
51
51
|
}))
|
|
52
52
|
), h(!0);
|
|
53
|
-
}, [s, e, c, d]), /* @__PURE__ */
|
|
54
|
-
|
|
53
|
+
}, [s, e, c, d]), /* @__PURE__ */ j(
|
|
54
|
+
xe.Provider,
|
|
55
55
|
{
|
|
56
56
|
value: {
|
|
57
57
|
isLoading: e,
|
|
@@ -61,7 +61,7 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
61
61
|
children: f
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
|
-
},
|
|
64
|
+
}, Ke = {
|
|
65
65
|
planner: {
|
|
66
66
|
label: "Planner",
|
|
67
67
|
icon: "calendar_month",
|
|
@@ -106,63 +106,63 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
106
106
|
"dataPortability"
|
|
107
107
|
]
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, ht = ({
|
|
110
110
|
children: f,
|
|
111
111
|
defaultTab: i = "feed",
|
|
112
112
|
hasLicense: s,
|
|
113
113
|
debug: e = {},
|
|
114
114
|
...r
|
|
115
115
|
}) => {
|
|
116
|
-
const c = r.user, d =
|
|
117
|
-
(
|
|
116
|
+
const c = r.user, d = Qe(c), h = "isGuest" in e ? e.isGuest : c?.data?.isGuest, { powerLicense: y, setPowerpackDialog: g } = ie(), p = "hasLicense" in e ? e.hasLicense : !!y || s, [l, n] = b({}), [u, m] = b([]), [S, v] = b([]), x = E(
|
|
117
|
+
(C) => l[C] ? l[C] : !1,
|
|
118
118
|
[l]
|
|
119
119
|
), D = E(
|
|
120
|
-
(
|
|
121
|
-
const
|
|
122
|
-
|
|
120
|
+
(C, N) => {
|
|
121
|
+
const R = { ...l };
|
|
122
|
+
R[C] = N, n(R);
|
|
123
123
|
},
|
|
124
124
|
[l]
|
|
125
|
-
), [o, a] =
|
|
126
|
-
(
|
|
127
|
-
const N = o[
|
|
128
|
-
return
|
|
125
|
+
), [o, a] = Ee(Te, {}), w = E(
|
|
126
|
+
(C) => {
|
|
127
|
+
const N = o[C];
|
|
128
|
+
return De(N) ? N : i;
|
|
129
129
|
},
|
|
130
130
|
[o, i]
|
|
131
|
-
), [P,
|
|
132
|
-
|
|
131
|
+
), [P, I] = b(null), M = E((C) => {
|
|
132
|
+
I(C);
|
|
133
133
|
}, []), F = E(() => {
|
|
134
|
-
|
|
134
|
+
I(null), P && U([]);
|
|
135
135
|
}, []);
|
|
136
136
|
B(() => {
|
|
137
137
|
F();
|
|
138
138
|
}, [r.useLocation().pathname]);
|
|
139
|
-
const [t,
|
|
140
|
-
|
|
139
|
+
const [t, k] = b(null), L = E((C) => {
|
|
140
|
+
k(C);
|
|
141
141
|
}, []), O = E(() => {
|
|
142
|
-
|
|
143
|
-
}, []), [
|
|
142
|
+
k(null);
|
|
143
|
+
}, []), [A, _] = b(null), [H, U] = b([]), { uriType: Y, uri: le, entity: $, getUriEntities: ce } = Fe(), [Q] = r.useSearchParams(), W = Q.get("project"), q = Q.get("type"), z = Q.get("id"), X = Q.get("activity");
|
|
144
144
|
B(() => {
|
|
145
145
|
if (!(!W && !q && !z)) {
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
if (
|
|
149
|
-
const N =
|
|
150
|
-
if (!N || !
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
153
|
-
const
|
|
146
|
+
if (Y === "entity" && $ && $.entityType !== "product") {
|
|
147
|
+
ce().then((C) => {
|
|
148
|
+
if (C.length === 0) return;
|
|
149
|
+
const N = C.find((ue) => ue.uri === le), R = N?.entities?.[0];
|
|
150
|
+
if (!N || !R) return;
|
|
151
|
+
const te = R?.projectName || $.projectName || "", ne = R.representationId || R.versionId || R.productId || R.taskId || R.folderId;
|
|
152
|
+
if (!te || !ne) return;
|
|
153
|
+
const de = {
|
|
154
154
|
entityType: $.entityType,
|
|
155
155
|
entities: [
|
|
156
156
|
{
|
|
157
|
-
id:
|
|
158
|
-
projectName:
|
|
157
|
+
id: ne,
|
|
158
|
+
projectName: te
|
|
159
159
|
}
|
|
160
160
|
],
|
|
161
161
|
source: "uri"
|
|
162
162
|
};
|
|
163
|
-
_(
|
|
164
|
-
}).catch((
|
|
165
|
-
console.warn("Failed to get URI entities:",
|
|
163
|
+
_(de);
|
|
164
|
+
}).catch((C) => {
|
|
165
|
+
console.warn("Failed to get URI entities:", C);
|
|
166
166
|
});
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
@@ -175,13 +175,13 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
175
175
|
}
|
|
176
176
|
],
|
|
177
177
|
source: "url"
|
|
178
|
-
}),
|
|
178
|
+
}), X && (U([X]), a({
|
|
179
179
|
...o,
|
|
180
180
|
overview: "feed"
|
|
181
181
|
})));
|
|
182
182
|
}
|
|
183
183
|
}, [W, q, z]);
|
|
184
|
-
const
|
|
184
|
+
const V = {
|
|
185
185
|
// open state for the panel by scope
|
|
186
186
|
panelOpenByScope: l,
|
|
187
187
|
getOpenForScope: x,
|
|
@@ -189,53 +189,53 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
189
189
|
setPanelOpenByScope: n,
|
|
190
190
|
// tab preferences
|
|
191
191
|
tabsByScope: o,
|
|
192
|
-
getTabForScope:
|
|
192
|
+
getTabForScope: w,
|
|
193
193
|
// slide out state
|
|
194
194
|
slideOut: P,
|
|
195
195
|
openSlideOut: M,
|
|
196
196
|
closeSlideOut: F,
|
|
197
197
|
// highlighted activities
|
|
198
|
-
highlightedActivities:
|
|
199
|
-
setHighlightedActivities:
|
|
198
|
+
highlightedActivities: H,
|
|
199
|
+
setHighlightedActivities: U,
|
|
200
200
|
// PiP state
|
|
201
201
|
pip: t,
|
|
202
|
-
openPip:
|
|
202
|
+
openPip: L,
|
|
203
203
|
closePip: O,
|
|
204
204
|
// entities state
|
|
205
|
-
entities:
|
|
205
|
+
entities: A,
|
|
206
206
|
setEntities: _,
|
|
207
207
|
feedAnnotations: u,
|
|
208
208
|
setFeedAnnotations: m,
|
|
209
|
-
feedFrameLinks:
|
|
209
|
+
feedFrameLinks: S,
|
|
210
210
|
setFeedFrameLinks: v,
|
|
211
211
|
bundleMode: d,
|
|
212
212
|
isGuest: h,
|
|
213
213
|
hasLicense: p,
|
|
214
214
|
onPowerFeature: g,
|
|
215
215
|
...r
|
|
216
|
-
};
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
},
|
|
219
|
-
const { setPowerpackDialog: i } =
|
|
216
|
+
}, J = fe(V), Z = J.current, ee = Object.keys(V);
|
|
217
|
+
return (ee.length !== Object.keys(Z).length || ee.some((C) => Z[C] !== V[C])) && (J.current = V), /* @__PURE__ */ j(je.Provider, { value: J.current, children: f });
|
|
218
|
+
}, Xe = (f) => {
|
|
219
|
+
const { setPowerpackDialog: i } = ie();
|
|
220
220
|
return B(() => {
|
|
221
221
|
i({ addon: "planner", feature: "subtasks" }), f?.onNotFound?.();
|
|
222
222
|
}, [i, f.onNotFound]), null;
|
|
223
|
-
},
|
|
224
|
-
const [i, { outdated: s, isLoading: e }] =
|
|
223
|
+
}, yt = ({ children: f }) => {
|
|
224
|
+
const [i, { outdated: s, isLoading: e }] = ae({
|
|
225
225
|
addon: "planner",
|
|
226
226
|
remote: "planner",
|
|
227
227
|
module: "SubtasksManager",
|
|
228
|
-
fallback:
|
|
228
|
+
fallback: Xe
|
|
229
229
|
});
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
|
|
230
|
+
return /* @__PURE__ */ j(
|
|
231
|
+
Me.Provider,
|
|
232
232
|
{
|
|
233
233
|
value: { SubtasksManager: i, requiredVersion: s?.required, isLoading: e },
|
|
234
234
|
children: f
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
|
-
},
|
|
238
|
-
const [i, s] =
|
|
237
|
+
}, Pt = ({ children: f }) => {
|
|
238
|
+
const [i, s] = b(!1), [e, r] = b(null), [c, d] = b(null), h = () => {
|
|
239
239
|
s(!0), r(null);
|
|
240
240
|
}, y = () => {
|
|
241
241
|
s(!1), r(null);
|
|
@@ -246,8 +246,8 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
246
246
|
}, l = () => {
|
|
247
247
|
r(null), d(null);
|
|
248
248
|
};
|
|
249
|
-
return /* @__PURE__ */
|
|
250
|
-
|
|
249
|
+
return /* @__PURE__ */ j(
|
|
250
|
+
Oe.Provider,
|
|
251
251
|
{
|
|
252
252
|
value: {
|
|
253
253
|
isPanelOpen: i,
|
|
@@ -264,17 +264,17 @@ const ut = ({ children: f, skip: i }) => {
|
|
|
264
264
|
}
|
|
265
265
|
);
|
|
266
266
|
};
|
|
267
|
-
function
|
|
268
|
-
const i = window.location.protocol === "https:" || window.location.hostname === "localhost", s = "documentPictureInPicture" in window && i, [e, r] =
|
|
267
|
+
function vt({ children: f }) {
|
|
268
|
+
const i = window.location.protocol === "https:" || window.location.hostname === "localhost", s = "documentPictureInPicture" in window && i, [e, r] = b(null), [c, d] = b(null), h = E(() => {
|
|
269
269
|
d(null), e != null && (e.close(), r(null));
|
|
270
270
|
}, [e, c]), y = E(
|
|
271
271
|
async (p, l) => {
|
|
272
272
|
if (!s) {
|
|
273
|
-
d(
|
|
273
|
+
d(K());
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
if (e != null) {
|
|
277
|
-
console.log("pipWindow is already open"), d(
|
|
277
|
+
console.log("pipWindow is already open"), d(K());
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
const n = await window.documentPictureInPicture.requestWindow({
|
|
@@ -283,7 +283,7 @@ function mt({ children: f }) {
|
|
|
283
283
|
});
|
|
284
284
|
n.addEventListener("pagehide", () => {
|
|
285
285
|
r(null), d(null);
|
|
286
|
-
}), r(n), d(
|
|
286
|
+
}), r(n), d(K());
|
|
287
287
|
},
|
|
288
288
|
[e, c]
|
|
289
289
|
);
|
|
@@ -308,28 +308,28 @@ function mt({ children: f }) {
|
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
310
|
}, [e]);
|
|
311
|
-
const g =
|
|
311
|
+
const g = T(() => ({
|
|
312
312
|
isSupported: s,
|
|
313
313
|
pipWindow: e,
|
|
314
314
|
pipId: c,
|
|
315
315
|
requestPipWindow: y,
|
|
316
316
|
closePipWindow: h
|
|
317
317
|
}), [h, s, e, y]);
|
|
318
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ j(Re.Provider, { value: g, children: f });
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const bt = ({
|
|
321
321
|
children: f,
|
|
322
322
|
projectName: i,
|
|
323
323
|
// utils
|
|
324
324
|
toast: s,
|
|
325
325
|
...e
|
|
326
326
|
}) => {
|
|
327
|
-
const { data: r } =
|
|
327
|
+
const { data: r } = Pe(
|
|
328
328
|
{ projectName: i },
|
|
329
329
|
{ skip: !i }
|
|
330
|
-
), { user: c } =
|
|
331
|
-
return /* @__PURE__ */
|
|
332
|
-
|
|
330
|
+
), { user: c } = re();
|
|
331
|
+
return /* @__PURE__ */ j(
|
|
332
|
+
Ae.Provider,
|
|
333
333
|
{
|
|
334
334
|
value: {
|
|
335
335
|
...e,
|
|
@@ -341,17 +341,17 @@ const ht = ({
|
|
|
341
341
|
children: f
|
|
342
342
|
}
|
|
343
343
|
);
|
|
344
|
-
},
|
|
344
|
+
}, wt = ({ children: f, ...i }) => /* @__PURE__ */ j(Ue.Provider, { value: { ...i }, children: f }), Ct = ({
|
|
345
345
|
children: f,
|
|
346
346
|
debug: i
|
|
347
347
|
}) => {
|
|
348
|
-
const [s, e] =
|
|
348
|
+
const [s, e] = b(null), [r, c] = b(null), d = (o) => o !== null && typeof o == "object" && "addon" in o, h = E((o) => {
|
|
349
349
|
o === null ? (e(null), c(null)) : d(o) ? (e(null), c(o)) : (c(null), e(o));
|
|
350
|
-
}, []), y = (o) => o ?
|
|
350
|
+
}, []), y = (o) => o ? ze[o] : null, g = (o) => {
|
|
351
351
|
if (!o) return null;
|
|
352
|
-
const a =
|
|
352
|
+
const a = Ke[o.addon];
|
|
353
353
|
return a ? { ...a, selectedFeature: o.feature } : null;
|
|
354
|
-
}, [p, l] =
|
|
354
|
+
}, [p, l] = b(!1), [n, u] = b(!0), m = async () => !1, [S, { isLoaded: v, isLoading: x }] = ae({
|
|
355
355
|
addon: "powerpack",
|
|
356
356
|
remote: "license",
|
|
357
357
|
module: "checkPowerLicense",
|
|
@@ -363,7 +363,7 @@ const ht = ({
|
|
|
363
363
|
console.warn("Using debug power license:", i.powerLicense), l(i.powerLicense), u(!1);
|
|
364
364
|
else if (v || !x) {
|
|
365
365
|
try {
|
|
366
|
-
const a = await
|
|
366
|
+
const a = await S();
|
|
367
367
|
l(a);
|
|
368
368
|
} catch (a) {
|
|
369
369
|
console.error("Error checking power license:", a), l(!1);
|
|
@@ -373,8 +373,8 @@ const ht = ({
|
|
|
373
373
|
u(!1);
|
|
374
374
|
}
|
|
375
375
|
})();
|
|
376
|
-
}, [i, v, x,
|
|
377
|
-
const D =
|
|
376
|
+
}, [i, v, x, S]);
|
|
377
|
+
const D = T(
|
|
378
378
|
() => ({
|
|
379
379
|
powerLicense: p,
|
|
380
380
|
isLoading: n,
|
|
@@ -386,23 +386,23 @@ const ht = ({
|
|
|
386
386
|
}),
|
|
387
387
|
[p, s, r, h, n]
|
|
388
388
|
);
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
-
},
|
|
389
|
+
return /* @__PURE__ */ j(Ne.Provider, { value: D, children: f });
|
|
390
|
+
}, St = ({ children: f, skip: i = !1 }) => {
|
|
391
391
|
const {
|
|
392
392
|
data: s = {},
|
|
393
393
|
isLoading: e,
|
|
394
394
|
error: r
|
|
395
|
-
} =
|
|
395
|
+
} = ve({ full: !0 }, { skip: i }), { data: c, isLoading: d, error: h } = be(), {
|
|
396
396
|
data: y = [],
|
|
397
397
|
isLoading: g,
|
|
398
398
|
error: p
|
|
399
|
-
} =
|
|
399
|
+
} = we({}, { skip: i }), l = T(() => y.filter((S) => S.active), [y]), {
|
|
400
400
|
data: n,
|
|
401
401
|
isLoading: u,
|
|
402
402
|
error: m
|
|
403
|
-
} =
|
|
404
|
-
return /* @__PURE__ */
|
|
405
|
-
|
|
403
|
+
} = Ce(void 0, { skip: !c?.name });
|
|
404
|
+
return /* @__PURE__ */ j(
|
|
405
|
+
Be.Provider,
|
|
406
406
|
{
|
|
407
407
|
value: {
|
|
408
408
|
siteInfo: s,
|
|
@@ -429,7 +429,7 @@ const ht = ({
|
|
|
429
429
|
children: f
|
|
430
430
|
}
|
|
431
431
|
);
|
|
432
|
-
},
|
|
432
|
+
}, It = ({
|
|
433
433
|
projectName: f,
|
|
434
434
|
children: i
|
|
435
435
|
}) => {
|
|
@@ -441,73 +441,73 @@ const ht = ({
|
|
|
441
441
|
isUninitialized: d,
|
|
442
442
|
error: h,
|
|
443
443
|
refetch: y
|
|
444
|
-
} =
|
|
444
|
+
} = Se({ projectName: f, attrib: !0 }), g = Je({ projectName: f }, r || e), p = T(() => {
|
|
445
445
|
const o = /* @__PURE__ */ new Map();
|
|
446
446
|
for (const a of s)
|
|
447
447
|
o.set(a.id, a);
|
|
448
448
|
return o;
|
|
449
|
-
}, [s]), l =
|
|
450
|
-
() => (o, a,
|
|
449
|
+
}, [s]), l = T(() => (o) => p.get(o), [p]), n = T(
|
|
450
|
+
() => (o, a, w = {}) => {
|
|
451
451
|
if (!a.length) return {};
|
|
452
|
-
const P = {},
|
|
452
|
+
const P = {}, I = new Set(a), M = /* @__PURE__ */ new Set();
|
|
453
453
|
let F = o;
|
|
454
|
-
for (;
|
|
454
|
+
for (; I.size > 0 && F && !M.has(F); ) {
|
|
455
455
|
M.add(F);
|
|
456
456
|
const t = p.get(F);
|
|
457
457
|
if (!t) break;
|
|
458
|
-
const
|
|
459
|
-
for (const
|
|
460
|
-
t.ownAttrib?.includes(
|
|
461
|
-
([O]) => O ===
|
|
462
|
-
)?.[1],
|
|
458
|
+
const k = t.attrib || {};
|
|
459
|
+
for (const L of Array.from(I))
|
|
460
|
+
t.ownAttrib?.includes(L) && L in k && (P[L] = Object.entries(k).find(
|
|
461
|
+
([O]) => O === L
|
|
462
|
+
)?.[1], I.delete(L));
|
|
463
463
|
F = t.parentId;
|
|
464
464
|
}
|
|
465
|
-
for (const t of Array.from(
|
|
466
|
-
t in
|
|
467
|
-
for (const t of
|
|
465
|
+
for (const t of Array.from(I))
|
|
466
|
+
t in w && (P[t] = w[t], I.delete(t));
|
|
467
|
+
for (const t of I)
|
|
468
468
|
P[t] = null;
|
|
469
469
|
return P;
|
|
470
470
|
},
|
|
471
471
|
[p]
|
|
472
|
-
), u =
|
|
472
|
+
), u = T(
|
|
473
473
|
() => (o) => {
|
|
474
|
-
const a = [],
|
|
474
|
+
const a = [], w = /* @__PURE__ */ new Set();
|
|
475
475
|
let P = o;
|
|
476
|
-
for (; P && !
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
if (!
|
|
480
|
-
a.push(
|
|
476
|
+
for (; P && !w.has(P); ) {
|
|
477
|
+
w.add(P);
|
|
478
|
+
const I = p.get(P);
|
|
479
|
+
if (!I?.parentId) break;
|
|
480
|
+
a.push(I.parentId), P = I.parentId;
|
|
481
481
|
}
|
|
482
482
|
return a;
|
|
483
483
|
},
|
|
484
484
|
[p]
|
|
485
|
-
), m =
|
|
485
|
+
), m = T(
|
|
486
486
|
() => (o) => {
|
|
487
487
|
const a = new Set(o);
|
|
488
|
-
return o.filter((
|
|
488
|
+
return o.filter((w) => !u(w).some((P) => a.has(P)));
|
|
489
489
|
},
|
|
490
490
|
[u]
|
|
491
|
-
),
|
|
491
|
+
), S = T(() => {
|
|
492
492
|
const o = /* @__PURE__ */ new Map();
|
|
493
493
|
for (const a of s) {
|
|
494
494
|
if (!a.parentId) continue;
|
|
495
|
-
const
|
|
496
|
-
|
|
495
|
+
const w = o.get(a.parentId);
|
|
496
|
+
w ? w.push(a.id) : o.set(a.parentId, [a.id]);
|
|
497
497
|
}
|
|
498
498
|
return o;
|
|
499
|
-
}, [s]), v =
|
|
499
|
+
}, [s]), v = T(
|
|
500
500
|
() => (o, a = !1) => {
|
|
501
|
-
const
|
|
501
|
+
const w = a ? [...o] : [], P = [...o];
|
|
502
502
|
for (; P.length > 0; ) {
|
|
503
|
-
const
|
|
504
|
-
for (const M of
|
|
505
|
-
|
|
503
|
+
const I = P.shift();
|
|
504
|
+
for (const M of S.get(I) || [])
|
|
505
|
+
w.push(M), P.push(M);
|
|
506
506
|
}
|
|
507
|
-
return
|
|
507
|
+
return w;
|
|
508
508
|
},
|
|
509
|
-
[
|
|
510
|
-
), x = () => y().unwrap(), D =
|
|
509
|
+
[S]
|
|
510
|
+
), x = () => y().unwrap(), D = T(
|
|
511
511
|
() => ({
|
|
512
512
|
folders: s,
|
|
513
513
|
getFolderById: l,
|
|
@@ -539,19 +539,19 @@ const ht = ({
|
|
|
539
539
|
x
|
|
540
540
|
]
|
|
541
541
|
);
|
|
542
|
-
return /* @__PURE__ */
|
|
543
|
-
},
|
|
544
|
-
const i = location.pathname, [s, e] =
|
|
542
|
+
return /* @__PURE__ */ j(Ge.Provider, { value: D, children: i });
|
|
543
|
+
}, kt = "uri", Lt = ({ children: f }) => {
|
|
544
|
+
const i = location.pathname, [s, e] = b(""), r = ["projects", "settings", "dashboard/tasks"];
|
|
545
545
|
B(() => {
|
|
546
546
|
r.some((u) => i.startsWith(`/${u}`)) || e("");
|
|
547
547
|
}, [i, e]);
|
|
548
|
-
const { type: c, entity: d, settings: h } =
|
|
549
|
-
({ projectName: n, folderPath: u, taskName: m, productName:
|
|
550
|
-
const x =
|
|
548
|
+
const { type: c, entity: d, settings: h } = We(s), y = E(
|
|
549
|
+
({ projectName: n, folderPath: u, taskName: m, productName: S, versionName: v }) => {
|
|
550
|
+
const x = qe({ projectName: n, folderPath: u, taskName: m, productName: S, versionName: v });
|
|
551
551
|
e(x);
|
|
552
552
|
},
|
|
553
553
|
[e]
|
|
554
|
-
), [g] =
|
|
554
|
+
), [g] = Ie(), p = E(async () => {
|
|
555
555
|
if (c !== "entity" || !s) return [];
|
|
556
556
|
try {
|
|
557
557
|
const n = await g({ resolveRequestModel: { uris: [s] } }).unwrap();
|
|
@@ -568,16 +568,16 @@ const ht = ({
|
|
|
568
568
|
setEntityUri: y,
|
|
569
569
|
getUriEntities: p
|
|
570
570
|
};
|
|
571
|
-
return /* @__PURE__ */
|
|
572
|
-
},
|
|
571
|
+
return /* @__PURE__ */ j(_e.Provider, { value: l, children: f });
|
|
572
|
+
}, se = [
|
|
573
573
|
"representation",
|
|
574
574
|
"version",
|
|
575
575
|
"workfile",
|
|
576
576
|
"product",
|
|
577
577
|
"task",
|
|
578
578
|
"folder"
|
|
579
|
-
],
|
|
580
|
-
const [i] =
|
|
579
|
+
], Ze = "delete-folder-with-children", xt = ({ children: f }) => {
|
|
580
|
+
const [i] = ke(), [s] = Le(), [e, r] = b(null), [c, d] = b(null), h = E(
|
|
581
581
|
(l) => new Promise((n) => d({ payload: l, resolve: n })),
|
|
582
582
|
[]
|
|
583
583
|
), y = E(
|
|
@@ -591,25 +591,25 @@ const ht = ({
|
|
|
591
591
|
G.error("No entities found");
|
|
592
592
|
return;
|
|
593
593
|
}
|
|
594
|
-
const
|
|
594
|
+
const S = new Set(m.map((t) => t.id)), v = m.filter((t) => t.entityType === "folder" && t.parentId ? !S.has(t.parentId) : (t.entityType === "task" || t.entityType === "product") && t.folderId ? !S.has(t.folderId) : !0), x = async (t, k) => {
|
|
595
595
|
if (t.length === 0) return;
|
|
596
|
-
const
|
|
596
|
+
const L = /* @__PURE__ */ new Map();
|
|
597
597
|
for (const O of t) {
|
|
598
|
-
const
|
|
599
|
-
|
|
598
|
+
const A = L.get(O.projectName) || [];
|
|
599
|
+
A.push(O), L.set(O.projectName, A);
|
|
600
600
|
}
|
|
601
601
|
await Promise.all(
|
|
602
|
-
Array.from(
|
|
603
|
-
const
|
|
604
|
-
(
|
|
605
|
-
).map((
|
|
602
|
+
Array.from(L.entries()).map(([O, A]) => {
|
|
603
|
+
const H = [...A].sort(
|
|
604
|
+
(U, Y) => se.indexOf(U.entityType) - se.indexOf(Y.entityType)
|
|
605
|
+
).map((U) => ({
|
|
606
606
|
type: "delete",
|
|
607
|
-
entityType:
|
|
608
|
-
entityId:
|
|
609
|
-
force:
|
|
607
|
+
entityType: U.entityType,
|
|
608
|
+
entityId: U.id,
|
|
609
|
+
force: k
|
|
610
610
|
}));
|
|
611
611
|
return i({
|
|
612
|
-
operationsRequestModel: { operations:
|
|
612
|
+
operationsRequestModel: { operations: H },
|
|
613
613
|
projectName: O
|
|
614
614
|
}).unwrap();
|
|
615
615
|
})
|
|
@@ -618,46 +618,46 @@ const ht = ({
|
|
|
618
618
|
try {
|
|
619
619
|
await x(v, !1), n?.onSuccess?.();
|
|
620
620
|
} catch (t) {
|
|
621
|
-
throw { message:
|
|
621
|
+
throw { message: he(t) || "Failed to delete entities", ...t };
|
|
622
622
|
}
|
|
623
623
|
}, o = () => x(
|
|
624
624
|
v.filter((t) => t.entityType === "folder" || t.entityType === "task"),
|
|
625
625
|
!0
|
|
626
626
|
), a = v.filter((t) => t.entityType === "folder");
|
|
627
|
-
let
|
|
627
|
+
let w = [];
|
|
628
628
|
if (a.length > 0) {
|
|
629
629
|
const t = /* @__PURE__ */ new Map();
|
|
630
|
-
for (const
|
|
631
|
-
const
|
|
632
|
-
|
|
630
|
+
for (const k of a) {
|
|
631
|
+
const L = t.get(k.projectName) || [];
|
|
632
|
+
L.push(k), t.set(k.projectName, L);
|
|
633
633
|
}
|
|
634
634
|
try {
|
|
635
|
-
|
|
635
|
+
w = (await Promise.all(
|
|
636
636
|
Array.from(t.entries()).map(
|
|
637
|
-
([
|
|
638
|
-
projectName:
|
|
639
|
-
folderIds: O.map((
|
|
637
|
+
([L, O]) => s({
|
|
638
|
+
projectName: L,
|
|
639
|
+
folderIds: O.map((A) => A.id)
|
|
640
640
|
}).unwrap()
|
|
641
641
|
)
|
|
642
642
|
)).flat();
|
|
643
|
-
} catch (
|
|
644
|
-
console.warn("Failed to fetch folder delete info, falling back to local data",
|
|
643
|
+
} catch (k) {
|
|
644
|
+
console.warn("Failed to fetch folder delete info, falling back to local data", k);
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
const P =
|
|
648
|
-
|
|
649
|
-
|
|
647
|
+
const P = Ve(a, w), I = v.filter((t) => t.entityType === "product").length;
|
|
648
|
+
I > 0 && P.push(
|
|
649
|
+
I > 1 ? "Deleting these products also deletes all their versions" : "Deleting this product also deletes all its versions"
|
|
650
650
|
);
|
|
651
|
-
const M =
|
|
651
|
+
const M = He(v), F = v.length === 1 ? v[0] : void 0;
|
|
652
652
|
r({
|
|
653
653
|
payload: {
|
|
654
654
|
entityLabel: M,
|
|
655
655
|
childrenDetails: P,
|
|
656
|
-
expectedCounts:
|
|
656
|
+
expectedCounts: Ye(v, w),
|
|
657
657
|
expectedName: F && (F.label || F.name || F.id)
|
|
658
658
|
},
|
|
659
659
|
accept: D,
|
|
660
|
-
recover: async (t) =>
|
|
660
|
+
recover: async (t) => me(t).includes(Ze) ? await h({
|
|
661
661
|
entityLabel: M,
|
|
662
662
|
message: `Are you really sure you want to delete ${M} and all of its dependencies? This cannot be undone. (NOT RECOMMENDED)`,
|
|
663
663
|
childrenDetails: [],
|
|
@@ -671,7 +671,7 @@ const ht = ({
|
|
|
671
671
|
if (!e) return;
|
|
672
672
|
const { payload: l, accept: n, recover: u } = e;
|
|
673
673
|
r(null);
|
|
674
|
-
const m = l.entityLabel,
|
|
674
|
+
const m = l.entityLabel, S = G.loading(`Deleting ${m}...`, { autoClose: !1 }), v = () => G.update(S, {
|
|
675
675
|
render: `${m} deleted`,
|
|
676
676
|
type: "success",
|
|
677
677
|
autoClose: 5e3,
|
|
@@ -685,7 +685,7 @@ const ht = ({
|
|
|
685
685
|
const a = await u(x);
|
|
686
686
|
if (a === "recovered") return v();
|
|
687
687
|
if (a === "cancelled")
|
|
688
|
-
return G.update(
|
|
688
|
+
return G.update(S, {
|
|
689
689
|
render: `${m} was not deleted`,
|
|
690
690
|
type: "info",
|
|
691
691
|
autoClose: 5e3,
|
|
@@ -695,26 +695,26 @@ const ht = ({
|
|
|
695
695
|
D = a;
|
|
696
696
|
}
|
|
697
697
|
const o = typeof D == "string" ? D : D?.message || D?.error || `Error deleting ${m}`;
|
|
698
|
-
G.update(
|
|
698
|
+
G.update(S, {
|
|
699
699
|
render: o,
|
|
700
700
|
type: "error",
|
|
701
701
|
autoClose: 5e3,
|
|
702
702
|
isLoading: !1
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
}, [e]), p =
|
|
706
|
-
return /* @__PURE__ */
|
|
705
|
+
}, [e]), p = T(() => ({ deleteEntities: y }), [y]);
|
|
706
|
+
return /* @__PURE__ */ pe($e.Provider, { value: p, children: [
|
|
707
707
|
f,
|
|
708
|
-
e && /* @__PURE__ */
|
|
709
|
-
|
|
708
|
+
e && /* @__PURE__ */ j(
|
|
709
|
+
oe,
|
|
710
710
|
{
|
|
711
711
|
payload: e.payload,
|
|
712
712
|
onConfirm: g,
|
|
713
713
|
onCancel: () => r(null)
|
|
714
714
|
}
|
|
715
715
|
),
|
|
716
|
-
c && /* @__PURE__ */
|
|
717
|
-
|
|
716
|
+
c && /* @__PURE__ */ j(
|
|
717
|
+
oe,
|
|
718
718
|
{
|
|
719
719
|
payload: c.payload,
|
|
720
720
|
onConfirm: () => {
|
|
@@ -728,75 +728,75 @@ const ht = ({
|
|
|
728
728
|
] });
|
|
729
729
|
};
|
|
730
730
|
export {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
731
|
+
Ue as AddonContext,
|
|
732
|
+
Ae as AddonProjectContext,
|
|
733
|
+
bt as AddonProjectProvider,
|
|
734
|
+
wt as AddonProvider,
|
|
735
|
+
$e as DeleteEntitiesContext,
|
|
736
|
+
xt as DeleteEntitiesProvider,
|
|
737
|
+
je as DetailsPanelContext,
|
|
738
|
+
ht as DetailsPanelProvider,
|
|
739
|
+
Ft as EntityUpdatesContext,
|
|
740
|
+
Pn as EntityUpdatesProvider,
|
|
741
|
+
vn as FORCE_AUTO_SYNC,
|
|
742
|
+
Be as GlobalContext,
|
|
743
|
+
St as GlobalProvider,
|
|
744
|
+
jt as MenuContext,
|
|
745
|
+
hn as MenuProvider,
|
|
746
|
+
Re as PiPContext,
|
|
747
|
+
vt as PiPProvider,
|
|
748
|
+
Tt as PiPWrapper,
|
|
749
|
+
Ne as PowerpackContext,
|
|
750
|
+
Ct as PowerpackProvider,
|
|
751
|
+
Mt as ProjectContext,
|
|
752
|
+
un as ProjectContextProvider,
|
|
753
|
+
Ge as ProjectFoldersContext,
|
|
754
|
+
It as ProjectFoldersContextProvider,
|
|
755
|
+
xe as RemoteModulesContext,
|
|
756
|
+
mt as RemoteModulesProvider,
|
|
757
|
+
Oe as SettingsPanelContext,
|
|
758
|
+
Pt as SettingsPanelProvider,
|
|
759
|
+
Ot as SocketContext,
|
|
760
|
+
Rt as SocketProvider,
|
|
761
|
+
Me as SubtasksModulesContext,
|
|
762
|
+
yt as SubtasksModulesProvider,
|
|
763
|
+
Te as TABS_BY_SCOPE_KEY,
|
|
764
|
+
At as ThumbnailUploadContext,
|
|
765
|
+
pn as ThumbnailUploadProvider,
|
|
766
|
+
_e as URIContext,
|
|
767
|
+
Lt as URIProvider,
|
|
768
|
+
kt as URL_PARAM_ID,
|
|
769
|
+
Ke as addonConfigs,
|
|
770
|
+
Ut as getActivityFrameLink,
|
|
771
|
+
Nt as getAutoSyncForTopic,
|
|
772
|
+
Bt as getUpdateType,
|
|
773
|
+
Gt as isDeletableEntityType,
|
|
774
|
+
De as isDetailsPanelTab,
|
|
775
|
+
_t as matchesProject,
|
|
776
|
+
$t as matchesTopic,
|
|
777
|
+
gn as powerpackFeatureOrder,
|
|
778
|
+
ze as powerpackFeatures,
|
|
779
|
+
Qt as setDetailsPanelTabForScope,
|
|
780
|
+
Wt as toggleSyncAll,
|
|
781
|
+
qt as useAddonContext,
|
|
782
|
+
zt as useAddonProjectContext,
|
|
783
|
+
Vt as useAutoSyncSettings,
|
|
784
|
+
Ht as useDeleteEntitiesContext,
|
|
785
|
+
Yt as useDeleteEntitiesContextOptional,
|
|
786
|
+
Jt as useDetailsPanelContext,
|
|
787
|
+
re as useGlobalContext,
|
|
788
|
+
Kt as useMenuContext,
|
|
789
|
+
Xt as useOptionalProjectContext,
|
|
790
|
+
Zt as usePiPWindow,
|
|
791
|
+
ie as usePowerpack,
|
|
792
|
+
en as useProjectContext,
|
|
793
|
+
tn as useProjectFoldersContext,
|
|
794
|
+
nn as useRemoteModules,
|
|
795
|
+
on as useScopedDetailsPanel,
|
|
796
|
+
sn as useSettingsPanel,
|
|
797
|
+
rn as useSocketContext,
|
|
798
|
+
an as useSubtasksModulesContext,
|
|
799
|
+
ln as useSyncUpdates,
|
|
800
|
+
cn as useThumbnailUploadContext,
|
|
801
|
+
Fe as useURIContext
|
|
802
802
|
};
|