@ynput/ayon-frontend-shared 0.9.0 → 0.10.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 +39 -39
- package/dist/ListTable.es.js +738 -651
- package/dist/NewEntity.es.js +2 -2
- package/dist/ProjectTreeTable.es.js +827 -827
- package/dist/Slicer.es.js +10 -10
- package/dist/Views.es.js +36 -34
- package/dist/chunks/ColumnDropIndicator.es.js +27 -21
- package/dist/chunks/EntityPickerDialog.es.js +19 -19
- package/dist/chunks/Feed.es.js +77 -77
- package/dist/chunks/FilmstripEntityCard.es.js +1 -1
- package/dist/chunks/MetaWidget.es.js +444 -439
- package/dist/chunks/ReviewablesSelector.es.js +1 -1
- package/dist/chunks/Slicer.es.js +32 -32
- package/dist/chunks/TableExportContextInstance.es.js +408 -469
- package/dist/chunks/Watchers.es.js +1 -1
- package/dist/chunks/getUris.es.js +1069 -1057
- package/dist/chunks/useLocalStorage.es.js +78 -0
- package/dist/components.es.js +50 -50
- package/dist/context.es.js +348 -337
- package/dist/hooks.es.js +218 -187
- package/dist/types/Actions.d.ts +17 -16
- package/dist/types/ContextMenu.d.ts +17 -16
- package/dist/types/DetailsPanel.d.ts +17 -16
- package/dist/types/EntityPickerDialog.d.ts +17 -16
- package/dist/types/Feed.d.ts +17 -16
- package/dist/types/ListTable.d.ts +27 -17
- package/dist/types/NewEntity.d.ts +17 -16
- package/dist/types/ProjectTreeTable.d.ts +18 -16
- package/dist/types/ProjectsTable.d.ts +17 -16
- package/dist/types/RepresentationsList.d.ts +17 -16
- package/dist/types/SimpleTable.d.ts +17 -16
- package/dist/types/Slicer.d.ts +17 -16
- package/dist/types/Views.d.ts +18 -17
- package/dist/types/api.d.ts +18 -17
- package/dist/types/components.d.ts +18 -17
- package/dist/types/context.d.ts +26 -17
- package/dist/types/hooks.d.ts +20 -17
- package/dist/types/index.d.ts +17 -16
- package/dist/types/util.d.ts +17 -16
- package/package.json +1 -1
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsxs as C, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { debounce as
|
|
4
|
-
import { confirmDialog as
|
|
2
|
+
import ne, { createContext as y, useContext as w, useState as I, useEffect as P, useRef as k, useCallback as V, useMemo as z, forwardRef as X } from "react";
|
|
3
|
+
import { debounce as re, isEqual as Ce } from "lodash";
|
|
4
|
+
import { confirmDialog as Pe } from "primereact/confirmdialog";
|
|
5
5
|
import { toast as F } from "react-toastify";
|
|
6
|
-
import { v4 as
|
|
7
|
-
import { bv as D, a as
|
|
6
|
+
import { v4 as Ee } from "uuid";
|
|
7
|
+
import { bv as D, a as Ie } from "./searchTerms.es.js";
|
|
8
8
|
import { f as ke } from "./realtimeUpdatesUtils.es.js";
|
|
9
9
|
import "axios";
|
|
10
|
-
import { cV as
|
|
11
|
-
import { useStore as
|
|
12
|
-
import { Button as
|
|
10
|
+
import { cV as Ve, aU as Ae, dD as Te, dG as se } from "./getUris.es.js";
|
|
11
|
+
import { useStore as De } from "react-redux";
|
|
12
|
+
import { Button as B, Icon as G, theme as le, Dialog as Re, InputText as ue } from "@ynput/ayon-react-components";
|
|
13
13
|
import v from "styled-components";
|
|
14
|
-
import
|
|
15
|
-
import { a as
|
|
14
|
+
import O from "clsx";
|
|
15
|
+
import { a as $e, K as ae } from "./platform.es.js";
|
|
16
16
|
import "@module-federation/enhanced/runtime";
|
|
17
17
|
import "@ynput/ayon-addon/host";
|
|
18
18
|
import "./ContextMenuContextInstance.es.js";
|
|
19
19
|
import { createPortal as _e } from "react-dom";
|
|
20
20
|
import { Dialog as je } from "primereact/dialog";
|
|
21
|
-
import
|
|
21
|
+
import Ne, { ReadyState as Oe } from "react-use-websocket";
|
|
22
22
|
import "react-router-dom";
|
|
23
23
|
import "semver";
|
|
24
|
-
const
|
|
24
|
+
const Le = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ */ C("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
25
25
|
e,
|
|
26
|
-
/* @__PURE__ */ p(
|
|
27
|
-
] }),
|
|
26
|
+
/* @__PURE__ */ p(B, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
|
|
27
|
+
] }), Me = y(void 0), io = () => w(Me) || {}, Ue = y({
|
|
28
28
|
isLoading: !0,
|
|
29
29
|
modules: [],
|
|
30
30
|
remotesInitialized: !1,
|
|
31
31
|
addonDev: { status: "off" }
|
|
32
|
-
}),
|
|
33
|
-
const e =
|
|
32
|
+
}), co = () => {
|
|
33
|
+
const e = w(Ue);
|
|
34
34
|
if (e === void 0)
|
|
35
35
|
throw new Error("useRemoteModules must be used within a RemoteModulesProvider");
|
|
36
36
|
return e;
|
|
37
|
-
},
|
|
37
|
+
}, W = "addonDev", L = "ayon-addon-dev", Fe = ["localhost", "127.0.0.1", "[::1]"], H = `use ?${W}=<addon>@http://localhost:<port>`, pe = (e) => {
|
|
38
38
|
try {
|
|
39
39
|
const { protocol: t, hostname: o } = new URL(e);
|
|
40
40
|
return ["http:", "https:"].includes(t) && Fe.includes(o);
|
|
41
41
|
} catch {
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, We = (e) => {
|
|
45
45
|
const t = e.indexOf("@");
|
|
46
46
|
if (t <= 0) return { request: e, reason: H };
|
|
47
47
|
const o = e.slice(0, t), r = e.slice(t + 1).replace(/\/+$/, "");
|
|
@@ -51,29 +51,29 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
|
|
|
51
51
|
} catch {
|
|
52
52
|
return { request: e, reason: `"${r}" is not a URL: ${H}` };
|
|
53
53
|
}
|
|
54
|
-
return ["http:", "https:"].includes(n.protocol) ?
|
|
54
|
+
return ["http:", "https:"].includes(n.protocol) ? pe(r) ? { override: { addon: o, url: r } } : {
|
|
55
55
|
request: e,
|
|
56
56
|
reason: `${n.hostname} is not this machine: only dev servers on localhost, 127.0.0.1 or [::1] can be loaded`
|
|
57
57
|
} : { request: e, reason: `the dev server URL must be http(s): ${H}` };
|
|
58
|
-
},
|
|
59
|
-
const e = new URLSearchParams(window.location.search).get(
|
|
58
|
+
}, lo = () => {
|
|
59
|
+
const e = new URLSearchParams(window.location.search).get(W);
|
|
60
60
|
if (e === "off" || e === "")
|
|
61
|
-
return localStorage.removeItem(
|
|
61
|
+
return localStorage.removeItem(L), null;
|
|
62
62
|
if (e) {
|
|
63
|
-
const t =
|
|
64
|
-
return "override" in t ? localStorage.setItem(
|
|
63
|
+
const t = We(e);
|
|
64
|
+
return "override" in t ? localStorage.setItem(L, JSON.stringify(t.override)) : console.warn(`[addon dev] ignored ?${W}=${e}: ${t.reason}`), t;
|
|
65
65
|
}
|
|
66
66
|
try {
|
|
67
|
-
const t = JSON.parse(localStorage.getItem(
|
|
68
|
-
return t &&
|
|
67
|
+
const t = JSON.parse(localStorage.getItem(L) || "null");
|
|
68
|
+
return t && pe(t.url) ? { override: t } : null;
|
|
69
69
|
} catch {
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, Be = () => localStorage.removeItem(L), qe = (e, { addon: t, url: o }) => {
|
|
73
73
|
const r = e ?? {}, n = ["name", "version", "remote", "buildId"].filter(
|
|
74
|
-
(
|
|
74
|
+
(s) => typeof r[s] != "string" || !r[s]
|
|
75
75
|
);
|
|
76
|
-
return (!Array.isArray(r.modules) || r.modules.some((
|
|
76
|
+
return (!Array.isArray(r.modules) || r.modules.some((s) => typeof s != "string" || !s)) && n.push("modules"), typeof e != "object" || !e || n.length ? `${o}/ayon-addon.json is invalid (no ${n.join(", ")}): is it served by \`ayon-addon dev --ayon\`?` : r.name !== t ? `the dev server at ${o} serves "${r.name}", not "${t}": open ?${W}=${r.name}@${o}` : null;
|
|
77
77
|
}, He = async (e) => {
|
|
78
78
|
const { url: t } = e;
|
|
79
79
|
let o;
|
|
@@ -96,7 +96,7 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
|
|
|
96
96
|
const n = qe(r, e);
|
|
97
97
|
if (n) throw new Error(n);
|
|
98
98
|
return r;
|
|
99
|
-
},
|
|
99
|
+
}, uo = (e) => e?.attrib?.developerMode || e?.data?.isService ? null : e?.data?.isDeveloper ? "only users in developer mode can load addons from a dev server: turn on Developer Mode in the header, then reload" : "only users in developer mode can load addons from a dev server, and this user is not a developer: an admin can turn on Developer in Studio settings > Users", ie = v.div`
|
|
100
100
|
position: fixed;
|
|
101
101
|
left: 8px;
|
|
102
102
|
bottom: 8px;
|
|
@@ -116,11 +116,11 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
|
|
|
116
116
|
color: var(--md-sys-color-on-error-container);
|
|
117
117
|
background: var(--md-sys-color-error-container);
|
|
118
118
|
}
|
|
119
|
-
`,
|
|
119
|
+
`, Je = 2e3, po = ({ state: e }) => {
|
|
120
120
|
const [t, o] = I(!1), r = e.status === "active" ? e.info.buildId : void 0;
|
|
121
|
-
|
|
121
|
+
P(() => {
|
|
122
122
|
if (e.status !== "active" && e.status !== "error") return;
|
|
123
|
-
const
|
|
123
|
+
const c = setInterval(() => {
|
|
124
124
|
He(e.override).then(
|
|
125
125
|
(g) => {
|
|
126
126
|
g.buildId !== r && (o(!0), window.location.reload());
|
|
@@ -129,53 +129,53 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
|
|
|
129
129
|
}
|
|
130
130
|
// the dev server restarting or still failing; keep polling
|
|
131
131
|
);
|
|
132
|
-
},
|
|
133
|
-
return () => clearInterval(
|
|
132
|
+
}, Je);
|
|
133
|
+
return () => clearInterval(c);
|
|
134
134
|
}, [e, r]);
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
135
|
+
const s = /* @__PURE__ */ p(B, { variant: "text", icon: "close", onClick: () => {
|
|
136
|
+
Be();
|
|
137
|
+
const c = new URL(window.location.href);
|
|
138
|
+
c.searchParams.delete("addonDev"), window.location.href = c.toString();
|
|
139
139
|
}, "data-tooltip": "Stop: load the installed addon" });
|
|
140
140
|
if (e.status === "rejected")
|
|
141
|
-
return /* @__PURE__ */ C(
|
|
142
|
-
/* @__PURE__ */ p(
|
|
141
|
+
return /* @__PURE__ */ C(ie, { className: "error", "data-addon-dev-rejected": e.request, children: [
|
|
142
|
+
/* @__PURE__ */ p(G, { icon: "error" }),
|
|
143
143
|
/* @__PURE__ */ C("span", { children: [
|
|
144
144
|
"Addon dev: ignored ?addonDev=",
|
|
145
145
|
e.request,
|
|
146
146
|
": ",
|
|
147
147
|
e.reason
|
|
148
148
|
] }),
|
|
149
|
-
|
|
149
|
+
s
|
|
150
150
|
] });
|
|
151
|
-
const { addon:
|
|
152
|
-
return /* @__PURE__ */ C(
|
|
153
|
-
/* @__PURE__ */ p(
|
|
151
|
+
const { addon: d, url: a } = e.override, i = "error" in e ? e.error : void 0;
|
|
152
|
+
return /* @__PURE__ */ C(ie, { className: i ? "error" : void 0, "data-addon-dev": d, children: [
|
|
153
|
+
/* @__PURE__ */ p(G, { icon: i ? "error" : "code" }),
|
|
154
154
|
e.status === "error" ? /* @__PURE__ */ C("span", { children: [
|
|
155
155
|
"Addon dev: ",
|
|
156
|
-
|
|
156
|
+
d,
|
|
157
157
|
" could not load from ",
|
|
158
|
-
|
|
158
|
+
a,
|
|
159
159
|
": ",
|
|
160
|
-
|
|
160
|
+
i
|
|
161
161
|
] }) : /* @__PURE__ */ C("span", { children: [
|
|
162
162
|
"Addon dev: ",
|
|
163
|
-
/* @__PURE__ */ p("strong", { children:
|
|
163
|
+
/* @__PURE__ */ p("strong", { children: d }),
|
|
164
164
|
" from ",
|
|
165
|
-
|
|
165
|
+
a,
|
|
166
166
|
e.status === "active" && ` (${e.info.version}, build ${e.info.buildId})`,
|
|
167
|
-
|
|
167
|
+
i && `: ${i}`,
|
|
168
168
|
t && ", reloading..."
|
|
169
169
|
] }),
|
|
170
|
-
|
|
170
|
+
s
|
|
171
171
|
] });
|
|
172
|
-
},
|
|
173
|
-
const e =
|
|
172
|
+
}, ze = y(void 0), go = () => {
|
|
173
|
+
const e = w(ze);
|
|
174
174
|
if (e === void 0)
|
|
175
175
|
throw new Error("usePowerpack must be used within a PowerpackProvider");
|
|
176
176
|
return e;
|
|
177
|
-
},
|
|
178
|
-
const e =
|
|
177
|
+
}, Ge = y(void 0), fo = () => {
|
|
178
|
+
const e = w(Ge);
|
|
179
179
|
if (e === void 0)
|
|
180
180
|
throw new Error("useURIContext must be used within a URIProvider");
|
|
181
181
|
return e;
|
|
@@ -186,14 +186,14 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
|
|
|
186
186
|
} catch {
|
|
187
187
|
return t;
|
|
188
188
|
}
|
|
189
|
-
},
|
|
189
|
+
}, Ke = (e, t) => {
|
|
190
190
|
if (typeof window > "u") return t;
|
|
191
191
|
try {
|
|
192
192
|
return M(sessionStorage.getItem(e), t);
|
|
193
193
|
} catch {
|
|
194
194
|
return t;
|
|
195
195
|
}
|
|
196
|
-
},
|
|
196
|
+
}, Ye = (e, t) => {
|
|
197
197
|
if (!(typeof window > "u"))
|
|
198
198
|
try {
|
|
199
199
|
sessionStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } }));
|
|
@@ -201,152 +201,94 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
|
|
|
201
201
|
console.error(o);
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
function
|
|
205
|
-
const o =
|
|
204
|
+
function Xe(e, t) {
|
|
205
|
+
const o = k(t);
|
|
206
206
|
o.current = t;
|
|
207
207
|
const [r, n] = I(() => typeof window > "u" ? t : M(sessionStorage.getItem(e), t));
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
n(M(
|
|
211
|
-
function
|
|
212
|
-
if ("key" in
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
208
|
+
P(() => {
|
|
209
|
+
const d = sessionStorage.getItem(e);
|
|
210
|
+
n(M(d, o.current)), d || sessionStorage.setItem(e, JSON.stringify(o.current));
|
|
211
|
+
function a(i) {
|
|
212
|
+
if ("key" in i && i.key && i.key !== e) return;
|
|
213
|
+
const c = i.detail?.key;
|
|
214
|
+
if (c && c !== e) return;
|
|
215
215
|
const g = sessionStorage.getItem(e);
|
|
216
216
|
n(M(g, o.current));
|
|
217
217
|
}
|
|
218
|
-
return window.addEventListener("session-storage",
|
|
219
|
-
window.removeEventListener("session-storage",
|
|
220
|
-
};
|
|
221
|
-
}, [e]);
|
|
222
|
-
const a = V(
|
|
223
|
-
(i) => {
|
|
224
|
-
try {
|
|
225
|
-
n((s) => {
|
|
226
|
-
const c = typeof i == "function" ? i(s) : i;
|
|
227
|
-
return sessionStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), c;
|
|
228
|
-
});
|
|
229
|
-
} catch (s) {
|
|
230
|
-
console.error(s);
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
[e]
|
|
234
|
-
);
|
|
235
|
-
return [r, a];
|
|
236
|
-
}
|
|
237
|
-
const U = (e, t = null) => {
|
|
238
|
-
if (!e) return t;
|
|
239
|
-
try {
|
|
240
|
-
return JSON.parse(e);
|
|
241
|
-
} catch {
|
|
242
|
-
return t;
|
|
243
|
-
}
|
|
244
|
-
}, Xe = (e, t) => {
|
|
245
|
-
if (typeof window > "u") return t;
|
|
246
|
-
try {
|
|
247
|
-
return U(localStorage.getItem(e), t);
|
|
248
|
-
} catch {
|
|
249
|
-
return t;
|
|
250
|
-
}
|
|
251
|
-
}, Ze = (e, t) => {
|
|
252
|
-
if (!(typeof window > "u"))
|
|
253
|
-
try {
|
|
254
|
-
localStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new Event("storage"));
|
|
255
|
-
} catch (o) {
|
|
256
|
-
console.error(o);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
function mo(e, t) {
|
|
260
|
-
const o = P(t);
|
|
261
|
-
o.current = t;
|
|
262
|
-
const [r, n] = I(() => {
|
|
263
|
-
const i = localStorage.getItem(e);
|
|
264
|
-
return U(i, t);
|
|
265
|
-
});
|
|
266
|
-
E(() => {
|
|
267
|
-
const i = localStorage.getItem(e);
|
|
268
|
-
n(U(i, o.current)), i || localStorage.setItem(e, JSON.stringify(o.current));
|
|
269
|
-
function s(c) {
|
|
270
|
-
if (c.key && c.key !== e) return;
|
|
271
|
-
const d = localStorage.getItem(e);
|
|
272
|
-
n(U(d, o.current));
|
|
273
|
-
}
|
|
274
|
-
return window.addEventListener("storage", s), () => {
|
|
275
|
-
window.removeEventListener("storage", s);
|
|
218
|
+
return window.addEventListener("session-storage", a), window.addEventListener("storage", a), () => {
|
|
219
|
+
window.removeEventListener("session-storage", a), window.removeEventListener("storage", a);
|
|
276
220
|
};
|
|
277
221
|
}, [e]);
|
|
278
|
-
const
|
|
279
|
-
(
|
|
222
|
+
const s = V(
|
|
223
|
+
(d) => {
|
|
280
224
|
try {
|
|
281
|
-
n((
|
|
282
|
-
const
|
|
283
|
-
return
|
|
284
|
-
window.dispatchEvent(new Event("storage"));
|
|
285
|
-
}, 0), c;
|
|
225
|
+
n((a) => {
|
|
226
|
+
const i = typeof d == "function" ? d(a) : d;
|
|
227
|
+
return sessionStorage.setItem(e, JSON.stringify(i)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), i;
|
|
286
228
|
});
|
|
287
|
-
} catch (
|
|
288
|
-
console.error(
|
|
229
|
+
} catch (a) {
|
|
230
|
+
console.error(a);
|
|
289
231
|
}
|
|
290
232
|
},
|
|
291
233
|
[e]
|
|
292
234
|
);
|
|
293
|
-
return [r,
|
|
235
|
+
return [r, s];
|
|
294
236
|
}
|
|
295
|
-
const
|
|
237
|
+
const Ze = y(void 0), Qe = ["feed", "subtasks", "details", "files"], et = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, tt = (e) => typeof e == "string" && et.test(e), ot = (e) => typeof e == "string" && (Qe.includes(e) || tt(e)), wo = (e) => {
|
|
296
238
|
const { startFrame: t, endFrame: o } = e.activityData || {}, r = e.origin?.id ?? e.entityId;
|
|
297
239
|
if (!Number.isSafeInteger(t) || !r) return null;
|
|
298
|
-
const n = t,
|
|
299
|
-
return { entityId: r, startFrame: n, endFrame:
|
|
300
|
-
},
|
|
301
|
-
const e =
|
|
240
|
+
const n = t, s = Number.isSafeInteger(o) ? Math.max(n, o) : n;
|
|
241
|
+
return { entityId: r, startFrame: n, endFrame: s };
|
|
242
|
+
}, nt = () => {
|
|
243
|
+
const e = w(Ze);
|
|
302
244
|
if (e === void 0)
|
|
303
245
|
throw new Error("useDetailsPanel must be used within a DetailsPanelProvider");
|
|
304
246
|
return e;
|
|
305
|
-
},
|
|
306
|
-
const o =
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
const { getOpenForScope: t, setPanelOpen: o, getTabForScope: r } =
|
|
247
|
+
}, K = "details/tabs-by-scope", ho = (e, t) => {
|
|
248
|
+
const o = Ke(K, {});
|
|
249
|
+
Ye(K, { ...o, [e]: t });
|
|
250
|
+
}, vo = (e) => {
|
|
251
|
+
const { getOpenForScope: t, setPanelOpen: o, getTabForScope: r } = nt(), [n, s] = Xe(K, {}), d = n[e], a = ot(d) ? d : r(e), i = V(
|
|
310
252
|
(g) => {
|
|
311
|
-
|
|
253
|
+
s((f) => ({ ...f, [e]: g }));
|
|
312
254
|
},
|
|
313
|
-
[e,
|
|
314
|
-
),
|
|
255
|
+
[e, s]
|
|
256
|
+
), c = a === "feed";
|
|
315
257
|
return {
|
|
316
258
|
isOpen: t(e),
|
|
317
259
|
setOpen: (g) => o(e, g),
|
|
318
|
-
currentTab:
|
|
319
|
-
setTab:
|
|
320
|
-
isFeed:
|
|
260
|
+
currentTab: a,
|
|
261
|
+
setTab: i,
|
|
262
|
+
isFeed: c
|
|
321
263
|
};
|
|
322
|
-
},
|
|
264
|
+
}, rt = y(
|
|
323
265
|
void 0
|
|
324
|
-
),
|
|
325
|
-
const e =
|
|
266
|
+
), mo = () => {
|
|
267
|
+
const e = w(rt);
|
|
326
268
|
if (!e)
|
|
327
269
|
throw new Error("useSubtasksModulesContext must be used within a SubtasksModulesProvider");
|
|
328
270
|
return e;
|
|
329
|
-
},
|
|
330
|
-
const e =
|
|
271
|
+
}, st = y({}), yo = () => {
|
|
272
|
+
const e = w(st);
|
|
331
273
|
if (!e)
|
|
332
274
|
throw new Error("useThumbnailUploadContext must be used within a ThumbnailUploadProvider");
|
|
333
275
|
return e;
|
|
334
|
-
},
|
|
335
|
-
const e =
|
|
276
|
+
}, at = y(void 0), xo = () => {
|
|
277
|
+
const e = w(at);
|
|
336
278
|
if (e === void 0)
|
|
337
279
|
throw new Error("useSettingsPanel must be used within a SettingsPanelProvider");
|
|
338
280
|
return e;
|
|
339
|
-
},
|
|
340
|
-
function
|
|
341
|
-
const e =
|
|
281
|
+
}, it = y(void 0);
|
|
282
|
+
function ct() {
|
|
283
|
+
const e = w(it);
|
|
342
284
|
if (e === void 0)
|
|
343
285
|
throw new Error("usePiPWindow must be used within a PiPContext");
|
|
344
286
|
return e;
|
|
345
287
|
}
|
|
346
|
-
function
|
|
288
|
+
function dt({ pipWindow: e, children: t }) {
|
|
347
289
|
return _e(t, e.document.body);
|
|
348
290
|
}
|
|
349
|
-
const
|
|
291
|
+
const lt = v(je)`
|
|
350
292
|
width: 25vw;
|
|
351
293
|
height: 70vh;
|
|
352
294
|
border: solid 1px var(--md-sys-color-outline-variant);
|
|
@@ -359,7 +301,7 @@ const ut = v(je)`
|
|
|
359
301
|
opacity: 1;
|
|
360
302
|
}
|
|
361
303
|
}
|
|
362
|
-
`,
|
|
304
|
+
`, ut = v(B)`
|
|
363
305
|
width: 26px;
|
|
364
306
|
height: 26px;
|
|
365
307
|
margin-left: auto;
|
|
@@ -375,12 +317,12 @@ const ut = v(je)`
|
|
|
375
317
|
&:hover {
|
|
376
318
|
background-color: #3d3e40;
|
|
377
319
|
}
|
|
378
|
-
`,
|
|
379
|
-
const { pipWindow: t, pipId: o, isSupported: r, closePipWindow: n } =
|
|
320
|
+
`, So = ({ children: e }) => {
|
|
321
|
+
const { pipWindow: t, pipId: o, isSupported: r, closePipWindow: n } = ct(), s = o && ne.isValidElement(e) ? ne.cloneElement(e, { id: o }) : e;
|
|
380
322
|
return !r && o ? /* @__PURE__ */ p(
|
|
381
|
-
|
|
323
|
+
lt,
|
|
382
324
|
{
|
|
383
|
-
header: /* @__PURE__ */ p(
|
|
325
|
+
header: /* @__PURE__ */ p(ut, { icon: "close", className: "close", onClick: n }),
|
|
384
326
|
headerStyle: {
|
|
385
327
|
padding: 4,
|
|
386
328
|
backgroundColor: "#202124",
|
|
@@ -401,113 +343,113 @@ const ut = v(je)`
|
|
|
401
343
|
},
|
|
402
344
|
onHide: n,
|
|
403
345
|
position: "right",
|
|
404
|
-
children:
|
|
346
|
+
children: s
|
|
405
347
|
}
|
|
406
|
-
) : t && /* @__PURE__ */ p(
|
|
407
|
-
},
|
|
408
|
-
const e =
|
|
348
|
+
) : t && /* @__PURE__ */ p(dt, { pipWindow: t, children: /* @__PURE__ */ p("div", { className: "pipRoot", children: s }) });
|
|
349
|
+
}, pt = y(void 0), bo = () => {
|
|
350
|
+
const e = w(pt);
|
|
409
351
|
if (!e)
|
|
410
352
|
throw new Error("useAddonProjectContext must be used within a AddonProjectContext");
|
|
411
353
|
return e;
|
|
412
|
-
},
|
|
413
|
-
const e =
|
|
354
|
+
}, gt = y(void 0), Co = () => {
|
|
355
|
+
const e = w(gt);
|
|
414
356
|
if (!e)
|
|
415
357
|
throw new Error("useAddonContext must be used within a AddonContext");
|
|
416
358
|
return e;
|
|
417
|
-
}, ft = y(void 0),
|
|
418
|
-
const e =
|
|
359
|
+
}, ft = y(void 0), Po = () => {
|
|
360
|
+
const e = w(ft);
|
|
419
361
|
if (e === void 0)
|
|
420
362
|
throw new Error("useMenuContext must be used within a MenuProvider");
|
|
421
363
|
return e;
|
|
422
|
-
},
|
|
423
|
-
const e =
|
|
364
|
+
}, ge = y(void 0), Eo = () => {
|
|
365
|
+
const e = w(ge);
|
|
424
366
|
if (e === void 0)
|
|
425
367
|
throw new Error("useSocketContext must be used within a SocketProvider");
|
|
426
368
|
return e;
|
|
427
|
-
},
|
|
369
|
+
}, wt = window.location.protocol.replace("http", "ws"), ht = `${wt}//${window.location.host}/ws`, Io = ({
|
|
428
370
|
children: e,
|
|
429
371
|
userName: t,
|
|
430
372
|
projectName: o,
|
|
431
373
|
dispatch: r
|
|
432
374
|
}) => {
|
|
433
|
-
const [n,
|
|
434
|
-
|
|
435
|
-
|
|
375
|
+
const [n, s] = I(!1), [d, a] = I([]), [i] = Ve(), c = k(!1);
|
|
376
|
+
P(() => {
|
|
377
|
+
c.current = n;
|
|
436
378
|
}, [n]);
|
|
437
379
|
const g = {
|
|
438
|
-
shouldReconnect: () => !t || !localStorage.getItem("accessToken") ? !1 : (
|
|
439
|
-
}, { sendMessage:
|
|
440
|
-
|
|
380
|
+
shouldReconnect: () => !t || !localStorage.getItem("accessToken") ? !1 : (i({ full: !1 }).unwrap(), !0)
|
|
381
|
+
}, { sendMessage: f, readyState: m, getWebSocket: u } = Ne(
|
|
382
|
+
ht,
|
|
441
383
|
g,
|
|
442
384
|
!!t
|
|
443
385
|
), l = () => {
|
|
444
|
-
|
|
386
|
+
f(
|
|
445
387
|
JSON.stringify({
|
|
446
388
|
topic: "auth",
|
|
447
389
|
token: localStorage.getItem("accessToken"),
|
|
448
|
-
subscribe:
|
|
390
|
+
subscribe: d,
|
|
449
391
|
project: o
|
|
450
392
|
})
|
|
451
393
|
);
|
|
452
394
|
};
|
|
453
|
-
|
|
454
|
-
console.debug("Topics changed",
|
|
455
|
-
}, [
|
|
456
|
-
const x =
|
|
457
|
-
x.current =
|
|
458
|
-
const h =
|
|
459
|
-
() =>
|
|
460
|
-
|
|
395
|
+
P(() => {
|
|
396
|
+
console.debug("Topics changed", d), l();
|
|
397
|
+
}, [d, o]);
|
|
398
|
+
const x = k(d);
|
|
399
|
+
x.current = d;
|
|
400
|
+
const h = z(
|
|
401
|
+
() => re((S) => {
|
|
402
|
+
Ce(x.current, S) || (console.log("WS: Subscriptions changed"), a(S));
|
|
461
403
|
}, 200),
|
|
462
404
|
[]
|
|
463
405
|
);
|
|
464
|
-
|
|
406
|
+
P(() => (D.setOnSubscriptionsChange((S) => h(S)), h(D.getSubscriptions("")), () => {
|
|
465
407
|
D.setOnSubscriptionsChange(null), h.cancel();
|
|
466
408
|
}), [h]);
|
|
467
|
-
const [b,
|
|
468
|
-
|
|
469
|
-
b && !R && (F.warning(/* @__PURE__ */ p(
|
|
409
|
+
const [b, j] = I(!1), [R, $] = I(!1);
|
|
410
|
+
P(() => {
|
|
411
|
+
b && !R && (F.warning(/* @__PURE__ */ p(Le, {}), {
|
|
470
412
|
autoClose: !1,
|
|
471
413
|
closeButton: !1
|
|
472
414
|
}), $(!0));
|
|
473
415
|
}, [b, R]);
|
|
474
|
-
const
|
|
475
|
-
console.log("Resetting API state due to server restart"),
|
|
476
|
-
}, 1e3),
|
|
416
|
+
const E = k({ callCount: 0, windowStart: Date.now() }), N = re(() => {
|
|
417
|
+
console.log("Resetting API state due to server restart"), s(!1), r(Ie.util.resetApiState());
|
|
418
|
+
}, 1e3), _ = V(
|
|
477
419
|
(S) => {
|
|
478
420
|
const q = Date.now();
|
|
479
|
-
if (q -
|
|
480
|
-
return
|
|
421
|
+
if (q - E.current.windowStart >= 1e3 && (E.current.windowStart = q, E.current.callCount = 0), E.current.callCount > 1e3)
|
|
422
|
+
return j(!0), console.log(
|
|
481
423
|
"Overload: Over 1000 messages per second. Ignoring subsequent messages."
|
|
482
424
|
);
|
|
483
425
|
let A;
|
|
484
426
|
try {
|
|
485
427
|
A = JSON.parse(S.data);
|
|
486
|
-
} catch (
|
|
487
|
-
console.error("Failed to parse websocket message:",
|
|
428
|
+
} catch (be) {
|
|
429
|
+
console.error("Failed to parse websocket message:", be, S.data);
|
|
488
430
|
return;
|
|
489
431
|
}
|
|
490
|
-
const { topic: T, sender:
|
|
491
|
-
if (
|
|
492
|
-
console.log("Server replica booted"),
|
|
432
|
+
const { topic: T, sender: oe, summary: xe, status: Se } = A || {};
|
|
433
|
+
if (c.current && (T === "heartbeat" || T === "server.started" && Se === "finished")) {
|
|
434
|
+
console.log("Server replica booted"), N();
|
|
493
435
|
return;
|
|
494
436
|
}
|
|
495
437
|
if (T !== "heartbeat") {
|
|
496
|
-
if (T === "server.restart_requested" && (console.log("Server restart requested"),
|
|
497
|
-
if (
|
|
498
|
-
} else if (
|
|
438
|
+
if (T === "server.restart_requested" && (console.log("Server restart requested"), s(!0)), ["import.data"].includes(T)) {
|
|
439
|
+
if (oe !== window.senderId) return;
|
|
440
|
+
} else if (oe === window.senderId)
|
|
499
441
|
return;
|
|
500
|
-
|
|
442
|
+
E.current.callCount += 1, console.log("Event RX", A), T === "shout" && A?.summary?.text && F.info(xe.text), D.publish(T, A);
|
|
501
443
|
}
|
|
502
444
|
},
|
|
503
|
-
[
|
|
445
|
+
[s]
|
|
504
446
|
);
|
|
505
|
-
return
|
|
506
|
-
m === Oe.OPEN && (u().onmessage =
|
|
447
|
+
return P(() => {
|
|
448
|
+
m === Oe.OPEN && (u().onmessage = _, l(), D.publish("client.connected", {
|
|
507
449
|
topic: "client.connected"
|
|
508
450
|
}));
|
|
509
451
|
}, [m, u]), /* @__PURE__ */ p(
|
|
510
|
-
|
|
452
|
+
ge.Provider,
|
|
511
453
|
{
|
|
512
454
|
value: {
|
|
513
455
|
getWebSocket: u,
|
|
@@ -517,19 +459,19 @@ const ut = v(je)`
|
|
|
517
459
|
children: e
|
|
518
460
|
}
|
|
519
461
|
);
|
|
520
|
-
}, fe = y(void 0),
|
|
521
|
-
const e =
|
|
462
|
+
}, fe = y(void 0), ko = () => {
|
|
463
|
+
const e = w(fe);
|
|
522
464
|
if (e === void 0)
|
|
523
465
|
throw new Error("useProjectContext must be used within a ProjectContextProvider");
|
|
524
466
|
return e;
|
|
525
|
-
},
|
|
467
|
+
}, Vo = () => w(fe), we = y(
|
|
526
468
|
void 0
|
|
527
|
-
),
|
|
528
|
-
const e =
|
|
469
|
+
), Ao = () => {
|
|
470
|
+
const e = w(we);
|
|
529
471
|
if (e === void 0)
|
|
530
472
|
throw new Error("useProjectFoldersContext must be used within a ProjectFoldersContextProvider");
|
|
531
473
|
return e;
|
|
532
|
-
},
|
|
474
|
+
}, To = () => w(we), Z = y(void 0), Q = (e) => ({
|
|
533
475
|
created: e,
|
|
534
476
|
label_changed: e,
|
|
535
477
|
renamed: e,
|
|
@@ -538,7 +480,7 @@ const ut = v(je)`
|
|
|
538
480
|
tags_changed: e,
|
|
539
481
|
attrib_changed: e,
|
|
540
482
|
deleted: e
|
|
541
|
-
}),
|
|
483
|
+
}), he = (e, t) => e === t || e.startsWith(`${t}.`), Y = (e, t) => t.length === 0 ? !0 : t.includes(e || ""), ve = (e) => {
|
|
542
484
|
const t = e.split(".").pop();
|
|
543
485
|
if (t && [
|
|
544
486
|
"created",
|
|
@@ -551,44 +493,44 @@ const ut = v(je)`
|
|
|
551
493
|
"deleted"
|
|
552
494
|
].includes(t))
|
|
553
495
|
return t;
|
|
554
|
-
},
|
|
496
|
+
}, Do = ({
|
|
555
497
|
projectNames: e,
|
|
556
498
|
topics: t,
|
|
557
499
|
isSyncing: o = !1,
|
|
558
500
|
shouldSyncOnUpdate: r
|
|
559
501
|
}) => {
|
|
560
|
-
const n =
|
|
502
|
+
const n = w(Z);
|
|
561
503
|
if (!n)
|
|
562
504
|
throw new Error("useSyncUpdates must be used within an EntityUpdatesProvider");
|
|
563
|
-
const
|
|
564
|
-
(
|
|
505
|
+
const s = e || n.projectNames, d = k(0), a = k(!1), i = n.updates.filter(
|
|
506
|
+
(c) => Y(c.project, s) && t.some((g) => he(c.topic, g)) && (r?.(c) ?? !0)
|
|
565
507
|
);
|
|
566
|
-
return
|
|
567
|
-
o && !
|
|
568
|
-
}, [n, o,
|
|
569
|
-
updates:
|
|
570
|
-
hasUpdates:
|
|
571
|
-
updateCount:
|
|
508
|
+
return P(() => {
|
|
509
|
+
o && !a.current ? d.current = n.getLatestId() : !o && a.current && n.acknowledge(t, s, d.current), a.current = o;
|
|
510
|
+
}, [n, o, s, t]), {
|
|
511
|
+
updates: i,
|
|
512
|
+
hasUpdates: i.length > 0,
|
|
513
|
+
updateCount: i.length
|
|
572
514
|
};
|
|
573
|
-
},
|
|
574
|
-
const e =
|
|
515
|
+
}, Ro = () => {
|
|
516
|
+
const e = w(Z);
|
|
575
517
|
if (!e)
|
|
576
518
|
throw new Error("useAutoSyncSettings must be used within an EntityUpdatesProvider");
|
|
577
519
|
const { autoSyncSettings: t, setAutoSyncSettings: o } = e;
|
|
578
520
|
return [t, (n) => {
|
|
579
|
-
const { settings:
|
|
580
|
-
o(
|
|
521
|
+
const { settings: s, global: d } = n;
|
|
522
|
+
o(d !== void 0 ? Q(d) : (a) => ({ ...a, ...s }));
|
|
581
523
|
}];
|
|
582
|
-
},
|
|
524
|
+
}, $o = (e, t) => {
|
|
583
525
|
if (!t) return !1;
|
|
584
|
-
const o =
|
|
526
|
+
const o = ve(e);
|
|
585
527
|
return o ? t[o] : !1;
|
|
586
|
-
},
|
|
587
|
-
id:
|
|
528
|
+
}, vt = () => Ee().replace(/-/g, ""), mt = (e = {}) => ({
|
|
529
|
+
id: vt(),
|
|
588
530
|
label: "Working",
|
|
589
531
|
working: !0,
|
|
590
532
|
settings: e
|
|
591
|
-
}),
|
|
533
|
+
}), yt = v.li`
|
|
592
534
|
position: relative;
|
|
593
535
|
padding: 4px 6px 4px 12px;
|
|
594
536
|
user-select: none;
|
|
@@ -641,7 +583,7 @@ const ut = v(je)`
|
|
|
641
583
|
display: flex;
|
|
642
584
|
}
|
|
643
585
|
}
|
|
644
|
-
`,
|
|
586
|
+
`, J = v(B)`
|
|
645
587
|
&.hasIcon {
|
|
646
588
|
padding: 2px;
|
|
647
589
|
}
|
|
@@ -659,67 +601,67 @@ const ut = v(je)`
|
|
|
659
601
|
}
|
|
660
602
|
}
|
|
661
603
|
}
|
|
662
|
-
`,
|
|
604
|
+
`, xt = X(
|
|
663
605
|
({
|
|
664
606
|
id: e,
|
|
665
607
|
label: t,
|
|
666
608
|
startContent: o,
|
|
667
609
|
endContent: r,
|
|
668
610
|
isSelected: n,
|
|
669
|
-
isEditable:
|
|
670
|
-
isSaveable:
|
|
671
|
-
highlighted:
|
|
672
|
-
onEdit:
|
|
673
|
-
onSave:
|
|
611
|
+
isEditable: s,
|
|
612
|
+
isSaveable: d,
|
|
613
|
+
highlighted: a,
|
|
614
|
+
onEdit: i,
|
|
615
|
+
onSave: c,
|
|
674
616
|
onResetView: g,
|
|
675
|
-
className:
|
|
617
|
+
className: f,
|
|
676
618
|
...m
|
|
677
619
|
}, u) => {
|
|
678
|
-
const { viewAlias: l } =
|
|
679
|
-
h.stopPropagation(), b ?
|
|
620
|
+
const { viewAlias: l } = ee(), x = (h, b) => {
|
|
621
|
+
h.stopPropagation(), b ? Pe({
|
|
680
622
|
message: `Save current ${l} settings and overwrite this ${l}?`,
|
|
681
623
|
header: "Confirm save",
|
|
682
|
-
accept: () =>
|
|
683
|
-
}) :
|
|
624
|
+
accept: () => c && c(h, e)
|
|
625
|
+
}) : c && c(h, e);
|
|
684
626
|
};
|
|
685
627
|
return /* @__PURE__ */ C(
|
|
686
|
-
|
|
628
|
+
yt,
|
|
687
629
|
{
|
|
688
630
|
...m,
|
|
689
631
|
id: e,
|
|
690
|
-
className:
|
|
632
|
+
className: O(f, { selected: n }),
|
|
691
633
|
ref: u,
|
|
692
634
|
children: [
|
|
693
635
|
o && o,
|
|
694
636
|
/* @__PURE__ */ p("span", { className: "label", children: t }),
|
|
695
637
|
g && /* @__PURE__ */ p(
|
|
696
|
-
|
|
638
|
+
J,
|
|
697
639
|
{
|
|
698
640
|
icon: "restart_alt",
|
|
699
641
|
variant: "text",
|
|
700
642
|
className: "reset",
|
|
701
643
|
onClick: g,
|
|
702
644
|
"data-tooltip": "Reset to Default",
|
|
703
|
-
"data-shortcut":
|
|
645
|
+
"data-shortcut": $e("0", [ae.Shift, ae.Ctrl])
|
|
704
646
|
}
|
|
705
647
|
),
|
|
706
|
-
|
|
707
|
-
|
|
648
|
+
s && d && !n && /* @__PURE__ */ p(
|
|
649
|
+
J,
|
|
708
650
|
{
|
|
709
651
|
icon: "save",
|
|
710
652
|
variant: "text",
|
|
711
|
-
className:
|
|
712
|
-
onClick: (h) => x(h,
|
|
653
|
+
className: O("save", { active: a === "save" }),
|
|
654
|
+
onClick: (h) => x(h, a !== "save"),
|
|
713
655
|
"data-tooltip": `Save ${l} settings from current ${l}`
|
|
714
656
|
}
|
|
715
657
|
),
|
|
716
|
-
|
|
717
|
-
|
|
658
|
+
s && i && /* @__PURE__ */ p(
|
|
659
|
+
J,
|
|
718
660
|
{
|
|
719
661
|
variant: "text",
|
|
720
662
|
icon: "more_horiz",
|
|
721
|
-
className:
|
|
722
|
-
onClick: (h) =>
|
|
663
|
+
className: O("more", { active: a === "edit" }),
|
|
664
|
+
onClick: (h) => i(h, e),
|
|
723
665
|
"data-tooltip": `Edit ${l}`
|
|
724
666
|
}
|
|
725
667
|
),
|
|
@@ -728,10 +670,10 @@ const ut = v(je)`
|
|
|
728
670
|
}
|
|
729
671
|
);
|
|
730
672
|
}
|
|
731
|
-
),
|
|
673
|
+
), St = v.div`
|
|
732
674
|
overflow: auto;
|
|
733
675
|
max-height: 40vh;
|
|
734
|
-
`,
|
|
676
|
+
`, bt = v.ul`
|
|
735
677
|
/* reset defaults */
|
|
736
678
|
margin: 0;
|
|
737
679
|
padding: 0;
|
|
@@ -741,17 +683,17 @@ const ut = v(je)`
|
|
|
741
683
|
flex-direction: column;
|
|
742
684
|
gap: var(--base-gap-small);
|
|
743
685
|
margin-bottom: var(--padding-s);
|
|
744
|
-
`,
|
|
686
|
+
`, Ct = v.li`
|
|
745
687
|
height: 1px;
|
|
746
688
|
background-color: var(--md-sys-color-outline-variant);
|
|
747
689
|
margin: 4px 0;
|
|
748
690
|
`;
|
|
749
691
|
v.li`
|
|
750
|
-
${
|
|
692
|
+
${le.labelSmall}
|
|
751
693
|
color: var(--md-sys-color-outline);
|
|
752
694
|
`;
|
|
753
|
-
const
|
|
754
|
-
${
|
|
695
|
+
const Pt = v.li`
|
|
696
|
+
${le.labelSmall}
|
|
755
697
|
color: var(--md-sys-color-outline);
|
|
756
698
|
user-select: none;
|
|
757
699
|
border-radius: var(--border-radius-m);
|
|
@@ -786,23 +728,23 @@ const It = v.li`
|
|
|
786
728
|
&:hover .icon {
|
|
787
729
|
display: inline-flex;
|
|
788
730
|
}
|
|
789
|
-
`,
|
|
731
|
+
`, Et = X(
|
|
790
732
|
({ title: e, collapsed: t, className: o, ...r }, n) => /* @__PURE__ */ C(
|
|
791
|
-
|
|
733
|
+
Pt,
|
|
792
734
|
{
|
|
793
735
|
...r,
|
|
794
|
-
className:
|
|
736
|
+
className: O("views-section-header", { collapsed: t }, o),
|
|
795
737
|
ref: n,
|
|
796
738
|
children: [
|
|
797
739
|
/* @__PURE__ */ p("span", { children: e }),
|
|
798
740
|
/* @__PURE__ */ p("span", { className: "spacer" }),
|
|
799
|
-
/* @__PURE__ */ p(
|
|
741
|
+
/* @__PURE__ */ p(G, { className: "icon", icon: "expand_more" })
|
|
800
742
|
]
|
|
801
743
|
}
|
|
802
744
|
)
|
|
803
|
-
),
|
|
804
|
-
({ items: e, selected: t, ...o }, r) => /* @__PURE__ */ p(
|
|
805
|
-
|
|
745
|
+
), _o = "_divider_", It = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", jo = X(
|
|
746
|
+
({ items: e, selected: t, ...o }, r) => /* @__PURE__ */ p(St, { children: /* @__PURE__ */ p(bt, { ...o, ref: r, children: e.map((n, s) => n === "_divider_" ? /* @__PURE__ */ p(Ct, {}, s) : It(n) ? /* @__PURE__ */ p(
|
|
747
|
+
Et,
|
|
806
748
|
{
|
|
807
749
|
id: n.id,
|
|
808
750
|
title: n.title,
|
|
@@ -811,32 +753,32 @@ const It = v.li`
|
|
|
811
753
|
},
|
|
812
754
|
n.id
|
|
813
755
|
) : /* @__PURE__ */ p(
|
|
814
|
-
|
|
756
|
+
xt,
|
|
815
757
|
{
|
|
816
758
|
tabIndex: 0,
|
|
817
759
|
isSelected: n.id === t,
|
|
818
|
-
autoFocus:
|
|
760
|
+
autoFocus: s === 0,
|
|
819
761
|
...n
|
|
820
762
|
},
|
|
821
|
-
(n.id || "") +
|
|
763
|
+
(n.id || "") + s.toString()
|
|
822
764
|
)) }) })
|
|
823
|
-
), kt = y(null),
|
|
824
|
-
const e =
|
|
765
|
+
), kt = y(null), ee = () => {
|
|
766
|
+
const e = w(kt);
|
|
825
767
|
if (!e)
|
|
826
768
|
throw new Error("useViewsContext must be used within a ViewsProvider");
|
|
827
769
|
return e;
|
|
828
770
|
};
|
|
829
|
-
let
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
|
|
771
|
+
let U = !1;
|
|
772
|
+
const ce = () => {
|
|
773
|
+
U || (U = !0, queueMicrotask(() => {
|
|
774
|
+
U = !1;
|
|
833
775
|
}));
|
|
834
|
-
},
|
|
776
|
+
}, Vt = async (e, t, o, r = {}, n, s, d, a) => {
|
|
835
777
|
const {
|
|
836
|
-
viewSettings:
|
|
837
|
-
viewType:
|
|
778
|
+
viewSettings: i,
|
|
779
|
+
viewType: c,
|
|
838
780
|
projectName: g,
|
|
839
|
-
selectedView:
|
|
781
|
+
selectedView: f,
|
|
840
782
|
setSelectedView: m,
|
|
841
783
|
workingView: u,
|
|
842
784
|
onSettingsChanged: l,
|
|
@@ -847,65 +789,65 @@ const de = () => {
|
|
|
847
789
|
h(e);
|
|
848
790
|
return;
|
|
849
791
|
}
|
|
850
|
-
if (!
|
|
851
|
-
const b =
|
|
792
|
+
if (!c) throw new Error("No view type provided for updating view settings");
|
|
793
|
+
const b = f?.id, j = f?.working;
|
|
852
794
|
try {
|
|
853
795
|
t(o);
|
|
854
|
-
const { settings: R, workingViewId: $ } =
|
|
855
|
-
if (
|
|
796
|
+
const { settings: R, workingViewId: $ } = d(), E = R ?? i;
|
|
797
|
+
if (E === void 0 && !x) {
|
|
856
798
|
console.warn(
|
|
857
799
|
"updateViewSettings: no settings baseline available, aborting to prevent data loss."
|
|
858
800
|
);
|
|
859
801
|
return;
|
|
860
802
|
}
|
|
861
|
-
const
|
|
862
|
-
S && (
|
|
863
|
-
const
|
|
803
|
+
const N = { ...E, ...e }, _ = mt(N), S = $ ?? u?.id;
|
|
804
|
+
S && (_.id = S);
|
|
805
|
+
const te = _.id, A = s(
|
|
864
806
|
{
|
|
865
|
-
payload: S ? { settings:
|
|
866
|
-
viewType:
|
|
807
|
+
payload: S ? { settings: N } : _,
|
|
808
|
+
viewType: c,
|
|
867
809
|
projectName: g
|
|
868
810
|
},
|
|
869
811
|
S
|
|
870
812
|
);
|
|
871
|
-
|
|
813
|
+
a(), (!j || f?.id !== S) && (f && l(!0), m(te)), await A, t(null), r.successMessage && F.success(r.successMessage);
|
|
872
814
|
} catch (R) {
|
|
873
|
-
t(null), b && m(b),
|
|
815
|
+
t(null), b && m(b), f && !j && l(!1);
|
|
874
816
|
const $ = r.errorMessage || `Failed to update view settings: ${R}`;
|
|
875
817
|
F.error($);
|
|
876
818
|
}
|
|
877
|
-
},
|
|
878
|
-
const [e] =
|
|
879
|
-
async (
|
|
880
|
-
if (
|
|
881
|
-
const
|
|
882
|
-
return ["label", "owner", "settings"].forEach((
|
|
883
|
-
|
|
819
|
+
}, At = () => {
|
|
820
|
+
const [e] = Ae(), [t] = Te(), o = ee(), r = De(), n = V(
|
|
821
|
+
async (a, i) => {
|
|
822
|
+
if (i) {
|
|
823
|
+
const c = {};
|
|
824
|
+
return ["label", "owner", "settings"].forEach((f) => {
|
|
825
|
+
a.payload[f] !== void 0 && (c[f] = a.payload[f]);
|
|
884
826
|
}), await t({
|
|
885
|
-
viewType:
|
|
886
|
-
projectName:
|
|
887
|
-
viewId:
|
|
888
|
-
genericViewPatchModel:
|
|
827
|
+
viewType: a.viewType,
|
|
828
|
+
projectName: a.projectName,
|
|
829
|
+
viewId: i,
|
|
830
|
+
genericViewPatchModel: c
|
|
889
831
|
}).unwrap();
|
|
890
832
|
} else
|
|
891
833
|
return await e({
|
|
892
|
-
viewType:
|
|
893
|
-
projectName:
|
|
894
|
-
genericViewPostModel:
|
|
834
|
+
viewType: a.viewType,
|
|
835
|
+
projectName: a.projectName,
|
|
836
|
+
genericViewPostModel: a.payload
|
|
895
837
|
}).unwrap();
|
|
896
838
|
},
|
|
897
839
|
[e, t]
|
|
898
|
-
),
|
|
899
|
-
const { viewType:
|
|
900
|
-
if (!
|
|
901
|
-
const
|
|
902
|
-
viewType:
|
|
903
|
-
projectName:
|
|
904
|
-
})(
|
|
905
|
-
viewType:
|
|
906
|
-
projectName:
|
|
907
|
-
})(
|
|
908
|
-
return (!!l && h === l ||
|
|
840
|
+
), s = V(() => {
|
|
841
|
+
const { viewType: a, projectName: i, selectedView: c, workingView: g } = o;
|
|
842
|
+
if (!a) return {};
|
|
843
|
+
const f = r.getState(), m = se.endpoints.getWorkingView.select({
|
|
844
|
+
viewType: a,
|
|
845
|
+
projectName: i
|
|
846
|
+
})(f), l = m?.data?.id || g?.id, x = se.endpoints.getDefaultView.select({
|
|
847
|
+
viewType: a,
|
|
848
|
+
projectName: i
|
|
849
|
+
})(f), h = x?.data?.id || c?.id;
|
|
850
|
+
return (!!l && h === l || U) && m?.data?.settings ? {
|
|
909
851
|
settings: m.data.settings,
|
|
910
852
|
workingViewId: l
|
|
911
853
|
} : x?.data?.settings ? {
|
|
@@ -915,53 +857,53 @@ const de = () => {
|
|
|
915
857
|
}, [r, o]);
|
|
916
858
|
return {
|
|
917
859
|
updateViewSettings: V(
|
|
918
|
-
async (...
|
|
919
|
-
[o, n,
|
|
860
|
+
async (...a) => await Vt(...a, o, n, s, ce),
|
|
861
|
+
[o, n, s]
|
|
920
862
|
),
|
|
921
863
|
onCreateView: n,
|
|
922
|
-
getLatestSettings:
|
|
923
|
-
markCacheDirty:
|
|
864
|
+
getLatestSettings: s,
|
|
865
|
+
markCacheDirty: ce
|
|
924
866
|
};
|
|
925
|
-
},
|
|
867
|
+
}, de = (e, t) => t.split(".").reduce((o, r) => o?.[r], e), me = (e, t, o) => {
|
|
926
868
|
const [r, ...n] = t.split(".");
|
|
927
869
|
return r ? {
|
|
928
870
|
...e,
|
|
929
|
-
[r]: n.length ?
|
|
871
|
+
[r]: n.length ? me(e[r] || {}, n.join("."), o) : o
|
|
930
872
|
} : e;
|
|
931
|
-
},
|
|
932
|
-
const { viewSettings: o, isLoadingViews: r } =
|
|
933
|
-
|
|
873
|
+
}, Tt = (e, t) => {
|
|
874
|
+
const { viewSettings: o, isLoadingViews: r } = ee(), { updateViewSettings: n, getLatestSettings: s } = At(), [d, a] = I(null), i = k(null), c = o, g = d !== null ? d : de(c, e) ?? t, f = V((u) => {
|
|
875
|
+
i.current = u, a(u);
|
|
934
876
|
}, []), m = V(
|
|
935
877
|
(u) => {
|
|
936
878
|
if (r) return;
|
|
937
|
-
const l =
|
|
879
|
+
const l = s().settings ?? c ?? {}, x = i.current !== null ? i.current : de(l, e) ?? t, h = typeof u == "function" ? u(
|
|
938
880
|
x
|
|
939
881
|
) : u;
|
|
940
882
|
n(
|
|
941
|
-
|
|
942
|
-
|
|
883
|
+
me(l, e, h),
|
|
884
|
+
f,
|
|
943
885
|
h,
|
|
944
886
|
{}
|
|
945
887
|
);
|
|
946
888
|
},
|
|
947
889
|
[
|
|
948
890
|
t,
|
|
949
|
-
|
|
891
|
+
s,
|
|
950
892
|
r,
|
|
951
893
|
e,
|
|
952
|
-
|
|
953
|
-
|
|
894
|
+
c,
|
|
895
|
+
f,
|
|
954
896
|
n
|
|
955
897
|
]
|
|
956
898
|
);
|
|
957
899
|
return [g, m];
|
|
958
|
-
},
|
|
959
|
-
const o =
|
|
960
|
-
() =>
|
|
900
|
+
}, No = !0, Dt = { ...Q(!0), created: !1 }, Oo = ({ children: e, projectNames: t }) => {
|
|
901
|
+
const o = k(0), [r = Q(!1), n] = Tt("autoSync"), [s, d] = I([]), a = z(
|
|
902
|
+
() => Dt,
|
|
961
903
|
[r]
|
|
962
904
|
);
|
|
963
|
-
|
|
964
|
-
let
|
|
905
|
+
P(() => {
|
|
906
|
+
let c = 0;
|
|
965
907
|
const g = ke(
|
|
966
908
|
(m) => {
|
|
967
909
|
const u = m.map(({ project: l, topic: x, updateType: h, message: b }) => ({
|
|
@@ -972,20 +914,20 @@ const de = () => {
|
|
|
972
914
|
entityId: b.summary?.entityId,
|
|
973
915
|
message: b
|
|
974
916
|
}));
|
|
975
|
-
|
|
917
|
+
d((l) => [...l, ...u]);
|
|
976
918
|
},
|
|
977
919
|
({ key: m }) => String(m),
|
|
978
920
|
0
|
|
979
|
-
),
|
|
980
|
-
if (!u?.topic || !
|
|
981
|
-
const l =
|
|
982
|
-
!l ||
|
|
921
|
+
), f = D.subscribeAll((m, u) => {
|
|
922
|
+
if (!u?.topic || !Y(u.project, t)) return;
|
|
923
|
+
const l = ve(u.topic);
|
|
924
|
+
!l || a[l] || l === "created" && ![
|
|
983
925
|
"entity.folder.created",
|
|
984
926
|
"entity.task.created",
|
|
985
927
|
"entity.product.created",
|
|
986
928
|
"entity.version.created"
|
|
987
929
|
].includes(u.topic) || g.add({
|
|
988
|
-
key: ++
|
|
930
|
+
key: ++c,
|
|
989
931
|
project: u.project,
|
|
990
932
|
topic: u.topic,
|
|
991
933
|
updateType: l,
|
|
@@ -993,30 +935,30 @@ const de = () => {
|
|
|
993
935
|
});
|
|
994
936
|
});
|
|
995
937
|
return () => {
|
|
996
|
-
D.unsubscribe(
|
|
938
|
+
D.unsubscribe(f), g.clear();
|
|
997
939
|
};
|
|
998
|
-
}, [
|
|
999
|
-
const
|
|
940
|
+
}, [a, t]);
|
|
941
|
+
const i = z(
|
|
1000
942
|
() => ({
|
|
1001
|
-
updates:
|
|
943
|
+
updates: s,
|
|
1002
944
|
projectNames: t,
|
|
1003
|
-
acknowledge: (
|
|
1004
|
-
|
|
945
|
+
acknowledge: (c, g, f) => {
|
|
946
|
+
d(
|
|
1005
947
|
(m) => m.filter(
|
|
1006
|
-
(u) => u.id >
|
|
948
|
+
(u) => u.id > f || !c.some((l) => he(u.topic, l)) || !Y(u.project, g)
|
|
1007
949
|
)
|
|
1008
950
|
);
|
|
1009
951
|
},
|
|
1010
952
|
getLatestId: () => o.current,
|
|
1011
|
-
autoSyncSettings:
|
|
953
|
+
autoSyncSettings: a,
|
|
1012
954
|
setAutoSyncSettings: n
|
|
1013
955
|
}),
|
|
1014
|
-
[
|
|
956
|
+
[a, t, n, s]
|
|
1015
957
|
);
|
|
1016
|
-
return /* @__PURE__ */ p(
|
|
1017
|
-
},
|
|
958
|
+
return /* @__PURE__ */ p(Z.Provider, { value: i, children: e });
|
|
959
|
+
}, Lo = 1, Rt = v.div`
|
|
1018
960
|
min-width: 350px;
|
|
1019
|
-
`,
|
|
961
|
+
`, $t = v.div`
|
|
1020
962
|
margin-top: 12px;
|
|
1021
963
|
min-height: 60px;
|
|
1022
964
|
min-width: 350px;
|
|
@@ -1027,32 +969,32 @@ const de = () => {
|
|
|
1027
969
|
margin-top: 12px;
|
|
1028
970
|
font-weight: 600;
|
|
1029
971
|
color: var(--md-sys-color-error);
|
|
1030
|
-
`,
|
|
972
|
+
`, Mo = ({
|
|
1031
973
|
entityLabel: e,
|
|
1032
974
|
childrenDetails: t,
|
|
1033
975
|
totalLine: o,
|
|
1034
976
|
message: r
|
|
1035
|
-
}) => /* @__PURE__ */ C(
|
|
977
|
+
}) => /* @__PURE__ */ C(Rt, { children: [
|
|
1036
978
|
/* @__PURE__ */ p("p", { children: r || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
|
|
1037
|
-
t.length > 0 && /* @__PURE__ */ C(
|
|
979
|
+
t.length > 0 && /* @__PURE__ */ C($t, { children: [
|
|
1038
980
|
/* @__PURE__ */ p(_t, { children: "The following will also be affected:" }),
|
|
1039
|
-
t.map((n,
|
|
981
|
+
t.map((n, s) => /* @__PURE__ */ p("p", { children: n }, s))
|
|
1040
982
|
] }),
|
|
1041
983
|
o && /* @__PURE__ */ p(jt, { children: o })
|
|
1042
|
-
] }),
|
|
984
|
+
] }), Uo = v(Re)`
|
|
1043
985
|
max-height: min(600px, 90vh);
|
|
1044
|
-
`,
|
|
986
|
+
`, Fo = v.div`
|
|
1045
987
|
display: flex;
|
|
1046
988
|
flex-direction: column;
|
|
1047
989
|
width: 100%;
|
|
1048
|
-
`,
|
|
990
|
+
`, Wo = v.label`
|
|
1049
991
|
margin: 2px 0 14px 0;
|
|
1050
|
-
`,
|
|
992
|
+
`, Bo = v.div`
|
|
1051
993
|
display: flex;
|
|
1052
994
|
padding-top: 14px;
|
|
1053
995
|
gap: 8px;
|
|
1054
996
|
justify-content: flex-end;
|
|
1055
|
-
`,
|
|
997
|
+
`, qo = v.div`
|
|
1056
998
|
display: flex;
|
|
1057
999
|
flex-direction: column;
|
|
1058
1000
|
gap: 8px;
|
|
@@ -1061,118 +1003,115 @@ const de = () => {
|
|
|
1061
1003
|
/* scroll container clips the inputs' 2px focus outline — inset it, then pull back to keep alignment */
|
|
1062
1004
|
padding: 4px;
|
|
1063
1005
|
margin: -4px;
|
|
1064
|
-
`,
|
|
1006
|
+
`, Ho = v.label`
|
|
1065
1007
|
display: flex;
|
|
1066
1008
|
align-items: center;
|
|
1067
1009
|
justify-content: space-between;
|
|
1068
1010
|
gap: 12px;
|
|
1069
|
-
`,
|
|
1011
|
+
`, Jo = v(ue)`
|
|
1070
1012
|
width: 180px;
|
|
1071
|
-
`,
|
|
1013
|
+
`, zo = v(ue)`
|
|
1072
1014
|
width: 100%;
|
|
1073
1015
|
/* room for the 2px focus outline */
|
|
1074
1016
|
margin: 2px 0;
|
|
1075
|
-
`,
|
|
1017
|
+
`, Nt = /* @__PURE__ */ new Set([
|
|
1076
1018
|
"folder",
|
|
1077
1019
|
"task",
|
|
1078
1020
|
"product",
|
|
1079
1021
|
"version",
|
|
1080
1022
|
"representation",
|
|
1081
1023
|
"workfile"
|
|
1082
|
-
]),
|
|
1083
|
-
const e =
|
|
1024
|
+
]), Go = (e) => !!e && Nt.has(e), ye = y(null), Ko = () => {
|
|
1025
|
+
const e = w(ye);
|
|
1084
1026
|
if (!e)
|
|
1085
1027
|
throw new Error("useDeleteEntitiesContext must be used within a DeleteEntitiesProvider");
|
|
1086
1028
|
return e;
|
|
1087
|
-
},
|
|
1029
|
+
}, Yo = () => w(ye), Xo = "tableExport", Ot = y(null), Zo = () => w(Ot);
|
|
1088
1030
|
export {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1031
|
+
wo as $,
|
|
1032
|
+
po as A,
|
|
1033
|
+
Ze as B,
|
|
1034
|
+
zo as C,
|
|
1035
|
+
Mo as D,
|
|
1036
|
+
rt as E,
|
|
1037
|
+
Fo as F,
|
|
1038
|
+
at as G,
|
|
1039
|
+
it as H,
|
|
1040
|
+
pt as I,
|
|
1041
|
+
gt as J,
|
|
1042
|
+
ze as K,
|
|
1043
|
+
Me as L,
|
|
1102
1044
|
ft as M,
|
|
1103
|
-
|
|
1104
|
-
|
|
1045
|
+
ye as N,
|
|
1046
|
+
Xo as O,
|
|
1105
1047
|
fe as P,
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1048
|
+
Ot as Q,
|
|
1049
|
+
Ue as R,
|
|
1050
|
+
Uo as S,
|
|
1051
|
+
st as T,
|
|
1052
|
+
Ge as U,
|
|
1053
|
+
Z as V,
|
|
1054
|
+
Oo as W,
|
|
1055
|
+
No as X,
|
|
1056
|
+
So as Y,
|
|
1057
|
+
ge as Z,
|
|
1058
|
+
Io as _,
|
|
1059
|
+
co as a,
|
|
1060
|
+
$o as a0,
|
|
1061
|
+
ve as a1,
|
|
1062
|
+
tt as a2,
|
|
1063
|
+
Go as a3,
|
|
1064
|
+
Y as a4,
|
|
1065
|
+
he as a5,
|
|
1066
|
+
ho as a6,
|
|
1067
|
+
Q as a7,
|
|
1068
|
+
Co as a8,
|
|
1069
|
+
bo as a9,
|
|
1070
|
+
Ro as aa,
|
|
1071
|
+
Ko as ab,
|
|
1072
|
+
Yo as ac,
|
|
1073
|
+
ct as ad,
|
|
1074
|
+
vo as ae,
|
|
1075
|
+
xo as af,
|
|
1076
|
+
Eo as ag,
|
|
1077
|
+
mo as ah,
|
|
1078
|
+
Do as ai,
|
|
1079
|
+
Zo as aj,
|
|
1080
|
+
yo as ak,
|
|
1081
|
+
mt as al,
|
|
1082
|
+
_o as am,
|
|
1083
|
+
kt as an,
|
|
1084
|
+
ee as ao,
|
|
1085
|
+
Et as ap,
|
|
1086
|
+
jo as aq,
|
|
1087
|
+
xt as ar,
|
|
1088
|
+
At as as,
|
|
1089
|
+
vt as at,
|
|
1090
|
+
Vt as au,
|
|
1149
1091
|
Tt as av,
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
po as x,
|
|
1176
|
-
He as y,
|
|
1177
|
-
Me as z
|
|
1092
|
+
go as b,
|
|
1093
|
+
io as c,
|
|
1094
|
+
Lo as d,
|
|
1095
|
+
Wo as e,
|
|
1096
|
+
qo as f,
|
|
1097
|
+
Ho as g,
|
|
1098
|
+
Jo as h,
|
|
1099
|
+
Bo as i,
|
|
1100
|
+
we as j,
|
|
1101
|
+
Vo as k,
|
|
1102
|
+
Xe as l,
|
|
1103
|
+
nt as m,
|
|
1104
|
+
Ao as n,
|
|
1105
|
+
ko as o,
|
|
1106
|
+
To as p,
|
|
1107
|
+
lo as q,
|
|
1108
|
+
Ke as r,
|
|
1109
|
+
uo as s,
|
|
1110
|
+
He as t,
|
|
1111
|
+
Po as u,
|
|
1112
|
+
Le as v,
|
|
1113
|
+
Ye as w,
|
|
1114
|
+
K as x,
|
|
1115
|
+
ot as y,
|
|
1116
|
+
fo as z
|
|
1178
1117
|
};
|