@ynput/ayon-frontend-shared 0.8.1 → 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 +4 -2
- package/dist/ProjectTreeTable.es.js +4208 -4185
- package/dist/ProjectsTable.es.js +5 -4
- package/dist/Slicer.es.js +327 -294
- package/dist/Views.es.js +725 -713
- package/dist/chunks/ColumnDropIndicator.es.js +33 -27
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +44 -38
- package/dist/chunks/EntityPickerDialog.es.js +19 -19
- package/dist/chunks/Feed.es.js +112 -110
- package/dist/chunks/FilmstripEntityCard.es.js +2 -2
- package/dist/chunks/GroupSettingsFallback.es.js +3 -2
- package/dist/chunks/MetaWidget.es.js +828 -809
- package/dist/chunks/NewEntityContextInstance.es.js +6 -5
- package/dist/chunks/ReviewablesSelector.es.js +76 -76
- package/dist/chunks/SimpleTable.es.js +151 -149
- package/dist/chunks/Slicer.es.js +637 -617
- package/dist/chunks/TableExportContextInstance.es.js +415 -471
- package/dist/chunks/ThumbnailSimple.es.js +11 -11
- package/dist/chunks/Watchers.es.js +46 -46
- package/dist/chunks/getUris.es.js +1069 -1057
- package/dist/chunks/searchTerms.es.js +617 -581
- package/dist/chunks/useCreateContextMenu.es.js +15 -13
- package/dist/chunks/useLocalStorage.es.js +78 -0
- package/dist/components.es.js +916 -884
- package/dist/context.es.js +348 -337
- package/dist/hooks.es.js +218 -187
- package/dist/index.es.js +11 -10
- package/dist/types/Actions.d.ts +17 -16
- package/dist/types/ContextMenu.d.ts +18 -17
- package/dist/types/DetailsPanel.d.ts +17 -16
- package/dist/types/EntityPickerDialog.d.ts +17 -16
- package/dist/types/Feed.d.ts +18 -17
- package/dist/types/ListTable.d.ts +28 -18
- package/dist/types/NewEntity.d.ts +19 -16
- package/dist/types/ProjectTreeTable.d.ts +62 -19
- package/dist/types/ProjectsTable.d.ts +18 -17
- package/dist/types/RepresentationsList.d.ts +17 -16
- package/dist/types/SimpleTable.d.ts +18 -17
- package/dist/types/Slicer.d.ts +24 -17
- package/dist/types/Views.d.ts +23 -17
- package/dist/types/api.d.ts +18 -17
- package/dist/types/components.d.ts +64 -18
- package/dist/types/context.d.ts +28 -18
- package/dist/types/hooks.d.ts +20 -17
- package/dist/types/index.d.ts +17 -16
- package/dist/types/util.d.ts +38 -16
- package/dist/util.es.js +116 -113
- package/package.json +2 -2
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsxs as C, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import ne, { createContext as y, useContext as
|
|
3
|
-
import { debounce as re, isEqual as
|
|
4
|
-
import { confirmDialog as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { v4 as
|
|
7
|
-
import { bv as D, a 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
|
+
import { toast as F } from "react-toastify";
|
|
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
14
|
import O from "clsx";
|
|
15
|
-
import { a as
|
|
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(/\/+$/, "");
|
|
@@ -55,25 +55,25 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
|
|
|
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(
|
|
67
|
+
const t = JSON.parse(localStorage.getItem(L) || "null");
|
|
68
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,71 +129,71 @@ 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
141
|
return /* @__PURE__ */ C(ie, { className: "error", "data-addon-dev-rejected": e.request, children: [
|
|
142
|
-
/* @__PURE__ */ p(
|
|
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(ie, { className:
|
|
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;
|
|
182
|
-
},
|
|
182
|
+
}, M = (e, t = null) => {
|
|
183
183
|
if (!e) return t;
|
|
184
184
|
try {
|
|
185
185
|
return JSON.parse(e);
|
|
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
|
-
return
|
|
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
|
-
const [r, n] = I(() => typeof window > "u" ? t :
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
n(
|
|
211
|
-
function
|
|
212
|
-
if ("key" in
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
207
|
+
const [r, n] = I(() => typeof window > "u" ? t : M(sessionStorage.getItem(e), t));
|
|
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
|
-
n(
|
|
216
|
+
n(M(g, o.current));
|
|
217
217
|
}
|
|
218
|
-
return window.addEventListener("session-storage",
|
|
219
|
-
window.removeEventListener("session-storage",
|
|
218
|
+
return window.addEventListener("session-storage", a), window.addEventListener("storage", a), () => {
|
|
219
|
+
window.removeEventListener("session-storage", a), window.removeEventListener("storage", a);
|
|
220
220
|
};
|
|
221
221
|
}, [e]);
|
|
222
|
-
const
|
|
223
|
-
(
|
|
222
|
+
const s = V(
|
|
223
|
+
(d) => {
|
|
224
224
|
try {
|
|
225
|
-
n((
|
|
226
|
-
const
|
|
227
|
-
return sessionStorage.setItem(e, JSON.stringify(
|
|
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;
|
|
228
228
|
});
|
|
229
|
-
} catch (
|
|
230
|
-
console.error(
|
|
229
|
+
} catch (a) {
|
|
230
|
+
console.error(a);
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
233
|
[e]
|
|
234
234
|
);
|
|
235
|
-
return [r,
|
|
235
|
+
return [r, s];
|
|
236
236
|
}
|
|
237
|
-
const
|
|
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 W(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 W(i, t);
|
|
265
|
-
});
|
|
266
|
-
E(() => {
|
|
267
|
-
const i = localStorage.getItem(e);
|
|
268
|
-
n(W(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(W(d, o.current));
|
|
273
|
-
}
|
|
274
|
-
return window.addEventListener("storage", s), () => {
|
|
275
|
-
window.removeEventListener("storage", s);
|
|
276
|
-
};
|
|
277
|
-
}, [e]);
|
|
278
|
-
const a = V(
|
|
279
|
-
(i) => {
|
|
280
|
-
try {
|
|
281
|
-
n((s) => {
|
|
282
|
-
const c = typeof i == "function" ? i(s) : i;
|
|
283
|
-
return localStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && setTimeout(() => {
|
|
284
|
-
window.dispatchEvent(new Event("storage"));
|
|
285
|
-
}, 0), c;
|
|
286
|
-
});
|
|
287
|
-
} catch (s) {
|
|
288
|
-
console.error(s);
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
[e]
|
|
292
|
-
);
|
|
293
|
-
return [r, a];
|
|
294
|
-
}
|
|
295
|
-
const Qe = y(void 0), et = ["feed", "subtasks", "details", "files"], tt = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, ot = (e) => typeof e == "string" && tt.test(e), nt = (e) => typeof e == "string" && (et.includes(e) || ot(e)), yo = (e) => {
|
|
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,109 +343,109 @@ 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
|
-
}, ge = y(void 0),
|
|
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
|
-
() => re((
|
|
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 [
|
|
468
|
-
|
|
469
|
-
|
|
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
|
-
}),
|
|
473
|
-
}, [
|
|
474
|
-
const
|
|
475
|
-
console.log("Resetting API state due to server restart"),
|
|
476
|
-
}, 1e3),
|
|
477
|
-
(
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
return
|
|
414
|
+
}), $(!0));
|
|
415
|
+
}, [b, R]);
|
|
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(
|
|
419
|
+
(S) => {
|
|
420
|
+
const q = Date.now();
|
|
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
|
-
let
|
|
425
|
+
let A;
|
|
484
426
|
try {
|
|
485
|
-
|
|
486
|
-
} catch (
|
|
487
|
-
console.error("Failed to parse websocket message:",
|
|
427
|
+
A = JSON.parse(S.data);
|
|
428
|
+
} catch (be) {
|
|
429
|
+
console.error("Failed to parse websocket message:", be, S.data);
|
|
488
430
|
return;
|
|
489
431
|
}
|
|
490
|
-
const { topic: T, sender: oe, summary:
|
|
491
|
-
if (
|
|
432
|
+
const { topic: T, sender: oe, summary: xe, status: Se } = A || {};
|
|
433
|
+
if (c.current && (T === "heartbeat" || T === "server.started" && Se === "finished")) {
|
|
492
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"),
|
|
438
|
+
if (T === "server.restart_requested" && (console.log("Server restart requested"), s(!0)), ["import.data"].includes(T)) {
|
|
497
439
|
if (oe !== window.senderId) return;
|
|
498
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(
|
|
@@ -517,19 +459,19 @@ const ut = v(je)`
|
|
|
517
459
|
children: e
|
|
518
460
|
}
|
|
519
461
|
);
|
|
520
|
-
},
|
|
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
|
-
}), he = (e, t) => e === t || e.startsWith(`${t}.`),
|
|
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
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(),
|
|
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: O(
|
|
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: O("save", { active:
|
|
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: O("more", { active:
|
|
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,7 +683,7 @@ 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;
|
|
@@ -750,7 +692,7 @@ v.li`
|
|
|
750
692
|
${le.labelSmall}
|
|
751
693
|
color: var(--md-sys-color-outline);
|
|
752
694
|
`;
|
|
753
|
-
const
|
|
695
|
+
const Pt = v.li`
|
|
754
696
|
${le.labelSmall}
|
|
755
697
|
color: var(--md-sys-color-outline);
|
|
756
698
|
user-select: none;
|
|
@@ -786,9 +728,9 @@ 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
736
|
className: O("views-section-header", { collapsed: t }, o),
|
|
@@ -796,13 +738,13 @@ const It = v.li`
|
|
|
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,96 +753,101 @@ 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
|
|
771
|
+
let U = !1;
|
|
830
772
|
const ce = () => {
|
|
831
|
-
|
|
832
|
-
|
|
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,
|
|
843
|
-
isErrorWorkingView: x
|
|
785
|
+
isErrorWorkingView: x,
|
|
786
|
+
updateControlledSettings: h
|
|
844
787
|
} = n;
|
|
845
|
-
if (
|
|
846
|
-
|
|
788
|
+
if (h) {
|
|
789
|
+
h(e);
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
792
|
+
if (!c) throw new Error("No view type provided for updating view settings");
|
|
793
|
+
const b = f?.id, j = f?.working;
|
|
847
794
|
try {
|
|
848
795
|
t(o);
|
|
849
|
-
const { settings:
|
|
850
|
-
if (
|
|
796
|
+
const { settings: R, workingViewId: $ } = d(), E = R ?? i;
|
|
797
|
+
if (E === void 0 && !x) {
|
|
851
798
|
console.warn(
|
|
852
799
|
"updateViewSettings: no settings baseline available, aborting to prevent data loss."
|
|
853
800
|
);
|
|
854
801
|
return;
|
|
855
802
|
}
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
-
const
|
|
803
|
+
const N = { ...E, ...e }, _ = mt(N), S = $ ?? u?.id;
|
|
804
|
+
S && (_.id = S);
|
|
805
|
+
const te = _.id, A = s(
|
|
859
806
|
{
|
|
860
|
-
payload:
|
|
861
|
-
viewType:
|
|
807
|
+
payload: S ? { settings: N } : _,
|
|
808
|
+
viewType: c,
|
|
862
809
|
projectName: g
|
|
863
810
|
},
|
|
864
|
-
|
|
811
|
+
S
|
|
865
812
|
);
|
|
866
|
-
|
|
867
|
-
} catch (
|
|
868
|
-
t(null),
|
|
869
|
-
const
|
|
870
|
-
|
|
813
|
+
a(), (!j || f?.id !== S) && (f && l(!0), m(te)), await A, t(null), r.successMessage && F.success(r.successMessage);
|
|
814
|
+
} catch (R) {
|
|
815
|
+
t(null), b && m(b), f && !j && l(!1);
|
|
816
|
+
const $ = r.errorMessage || `Failed to update view settings: ${R}`;
|
|
817
|
+
F.error($);
|
|
871
818
|
}
|
|
872
|
-
},
|
|
873
|
-
const [e] =
|
|
874
|
-
async (
|
|
875
|
-
if (
|
|
876
|
-
const
|
|
877
|
-
return ["label", "owner", "settings"].forEach((
|
|
878
|
-
|
|
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]);
|
|
879
826
|
}), await t({
|
|
880
|
-
viewType:
|
|
881
|
-
projectName:
|
|
882
|
-
viewId:
|
|
883
|
-
genericViewPatchModel:
|
|
827
|
+
viewType: a.viewType,
|
|
828
|
+
projectName: a.projectName,
|
|
829
|
+
viewId: i,
|
|
830
|
+
genericViewPatchModel: c
|
|
884
831
|
}).unwrap();
|
|
885
832
|
} else
|
|
886
833
|
return await e({
|
|
887
|
-
viewType:
|
|
888
|
-
projectName:
|
|
889
|
-
genericViewPostModel:
|
|
834
|
+
viewType: a.viewType,
|
|
835
|
+
projectName: a.projectName,
|
|
836
|
+
genericViewPostModel: a.payload
|
|
890
837
|
}).unwrap();
|
|
891
838
|
},
|
|
892
839
|
[e, t]
|
|
893
|
-
),
|
|
894
|
-
const { viewType:
|
|
895
|
-
if (!
|
|
896
|
-
const
|
|
897
|
-
viewType:
|
|
898
|
-
projectName:
|
|
899
|
-
})(
|
|
900
|
-
viewType:
|
|
901
|
-
projectName:
|
|
902
|
-
})(
|
|
903
|
-
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 ? {
|
|
904
851
|
settings: m.data.settings,
|
|
905
852
|
workingViewId: l
|
|
906
853
|
} : x?.data?.settings ? {
|
|
@@ -910,11 +857,11 @@ const ce = () => {
|
|
|
910
857
|
}, [r, o]);
|
|
911
858
|
return {
|
|
912
859
|
updateViewSettings: V(
|
|
913
|
-
async (...
|
|
914
|
-
[o, n,
|
|
860
|
+
async (...a) => await Vt(...a, o, n, s, ce),
|
|
861
|
+
[o, n, s]
|
|
915
862
|
),
|
|
916
863
|
onCreateView: n,
|
|
917
|
-
getLatestSettings:
|
|
864
|
+
getLatestSettings: s,
|
|
918
865
|
markCacheDirty: ce
|
|
919
866
|
};
|
|
920
867
|
}, de = (e, t) => t.split(".").reduce((o, r) => o?.[r], e), me = (e, t, o) => {
|
|
@@ -923,64 +870,64 @@ const ce = () => {
|
|
|
923
870
|
...e,
|
|
924
871
|
[r]: n.length ? me(e[r] || {}, n.join("."), o) : o
|
|
925
872
|
} : e;
|
|
926
|
-
},
|
|
927
|
-
const { viewSettings: o, isLoadingViews: r } =
|
|
928
|
-
|
|
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);
|
|
929
876
|
}, []), m = V(
|
|
930
877
|
(u) => {
|
|
931
878
|
if (r) return;
|
|
932
|
-
const l =
|
|
879
|
+
const l = s().settings ?? c ?? {}, x = i.current !== null ? i.current : de(l, e) ?? t, h = typeof u == "function" ? u(
|
|
933
880
|
x
|
|
934
881
|
) : u;
|
|
935
882
|
n(
|
|
936
883
|
me(l, e, h),
|
|
937
|
-
|
|
884
|
+
f,
|
|
938
885
|
h,
|
|
939
886
|
{}
|
|
940
887
|
);
|
|
941
888
|
},
|
|
942
889
|
[
|
|
943
890
|
t,
|
|
944
|
-
|
|
891
|
+
s,
|
|
945
892
|
r,
|
|
946
893
|
e,
|
|
947
|
-
|
|
948
|
-
|
|
894
|
+
c,
|
|
895
|
+
f,
|
|
949
896
|
n
|
|
950
897
|
]
|
|
951
898
|
);
|
|
952
899
|
return [g, m];
|
|
953
|
-
},
|
|
954
|
-
const o =
|
|
955
|
-
() =>
|
|
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,
|
|
956
903
|
[r]
|
|
957
904
|
);
|
|
958
|
-
|
|
959
|
-
let
|
|
905
|
+
P(() => {
|
|
906
|
+
let c = 0;
|
|
960
907
|
const g = ke(
|
|
961
908
|
(m) => {
|
|
962
|
-
const u = m.map(({ project: l, topic: x, updateType: h, message:
|
|
909
|
+
const u = m.map(({ project: l, topic: x, updateType: h, message: b }) => ({
|
|
963
910
|
id: ++o.current,
|
|
964
911
|
project: l,
|
|
965
912
|
topic: x,
|
|
966
913
|
updateType: h,
|
|
967
|
-
entityId:
|
|
968
|
-
message:
|
|
914
|
+
entityId: b.summary?.entityId,
|
|
915
|
+
message: b
|
|
969
916
|
}));
|
|
970
|
-
|
|
917
|
+
d((l) => [...l, ...u]);
|
|
971
918
|
},
|
|
972
919
|
({ key: m }) => String(m),
|
|
973
920
|
0
|
|
974
|
-
),
|
|
975
|
-
if (!u?.topic || !
|
|
921
|
+
), f = D.subscribeAll((m, u) => {
|
|
922
|
+
if (!u?.topic || !Y(u.project, t)) return;
|
|
976
923
|
const l = ve(u.topic);
|
|
977
|
-
!l ||
|
|
924
|
+
!l || a[l] || l === "created" && ![
|
|
978
925
|
"entity.folder.created",
|
|
979
926
|
"entity.task.created",
|
|
980
927
|
"entity.product.created",
|
|
981
928
|
"entity.version.created"
|
|
982
929
|
].includes(u.topic) || g.add({
|
|
983
|
-
key: ++
|
|
930
|
+
key: ++c,
|
|
984
931
|
project: u.project,
|
|
985
932
|
topic: u.topic,
|
|
986
933
|
updateType: l,
|
|
@@ -988,30 +935,30 @@ const ce = () => {
|
|
|
988
935
|
});
|
|
989
936
|
});
|
|
990
937
|
return () => {
|
|
991
|
-
D.unsubscribe(
|
|
938
|
+
D.unsubscribe(f), g.clear();
|
|
992
939
|
};
|
|
993
|
-
}, [
|
|
994
|
-
const
|
|
940
|
+
}, [a, t]);
|
|
941
|
+
const i = z(
|
|
995
942
|
() => ({
|
|
996
|
-
updates:
|
|
943
|
+
updates: s,
|
|
997
944
|
projectNames: t,
|
|
998
|
-
acknowledge: (
|
|
999
|
-
|
|
945
|
+
acknowledge: (c, g, f) => {
|
|
946
|
+
d(
|
|
1000
947
|
(m) => m.filter(
|
|
1001
|
-
(u) => u.id >
|
|
948
|
+
(u) => u.id > f || !c.some((l) => he(u.topic, l)) || !Y(u.project, g)
|
|
1002
949
|
)
|
|
1003
950
|
);
|
|
1004
951
|
},
|
|
1005
952
|
getLatestId: () => o.current,
|
|
1006
|
-
autoSyncSettings:
|
|
953
|
+
autoSyncSettings: a,
|
|
1007
954
|
setAutoSyncSettings: n
|
|
1008
955
|
}),
|
|
1009
|
-
[
|
|
956
|
+
[a, t, n, s]
|
|
1010
957
|
);
|
|
1011
|
-
return /* @__PURE__ */ p(
|
|
1012
|
-
},
|
|
958
|
+
return /* @__PURE__ */ p(Z.Provider, { value: i, children: e });
|
|
959
|
+
}, Lo = 1, Rt = v.div`
|
|
1013
960
|
min-width: 350px;
|
|
1014
|
-
`,
|
|
961
|
+
`, $t = v.div`
|
|
1015
962
|
margin-top: 12px;
|
|
1016
963
|
min-height: 60px;
|
|
1017
964
|
min-width: 350px;
|
|
@@ -1022,32 +969,32 @@ const ce = () => {
|
|
|
1022
969
|
margin-top: 12px;
|
|
1023
970
|
font-weight: 600;
|
|
1024
971
|
color: var(--md-sys-color-error);
|
|
1025
|
-
`,
|
|
972
|
+
`, Mo = ({
|
|
1026
973
|
entityLabel: e,
|
|
1027
974
|
childrenDetails: t,
|
|
1028
975
|
totalLine: o,
|
|
1029
976
|
message: r
|
|
1030
|
-
}) => /* @__PURE__ */ C(
|
|
977
|
+
}) => /* @__PURE__ */ C(Rt, { children: [
|
|
1031
978
|
/* @__PURE__ */ p("p", { children: r || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
|
|
1032
|
-
t.length > 0 && /* @__PURE__ */ C(
|
|
979
|
+
t.length > 0 && /* @__PURE__ */ C($t, { children: [
|
|
1033
980
|
/* @__PURE__ */ p(_t, { children: "The following will also be affected:" }),
|
|
1034
|
-
t.map((n,
|
|
981
|
+
t.map((n, s) => /* @__PURE__ */ p("p", { children: n }, s))
|
|
1035
982
|
] }),
|
|
1036
983
|
o && /* @__PURE__ */ p(jt, { children: o })
|
|
1037
|
-
] }),
|
|
984
|
+
] }), Uo = v(Re)`
|
|
1038
985
|
max-height: min(600px, 90vh);
|
|
1039
|
-
`,
|
|
986
|
+
`, Fo = v.div`
|
|
1040
987
|
display: flex;
|
|
1041
988
|
flex-direction: column;
|
|
1042
989
|
width: 100%;
|
|
1043
|
-
`,
|
|
990
|
+
`, Wo = v.label`
|
|
1044
991
|
margin: 2px 0 14px 0;
|
|
1045
|
-
`,
|
|
992
|
+
`, Bo = v.div`
|
|
1046
993
|
display: flex;
|
|
1047
994
|
padding-top: 14px;
|
|
1048
995
|
gap: 8px;
|
|
1049
996
|
justify-content: flex-end;
|
|
1050
|
-
`,
|
|
997
|
+
`, qo = v.div`
|
|
1051
998
|
display: flex;
|
|
1052
999
|
flex-direction: column;
|
|
1053
1000
|
gap: 8px;
|
|
@@ -1056,118 +1003,115 @@ const ce = () => {
|
|
|
1056
1003
|
/* scroll container clips the inputs' 2px focus outline — inset it, then pull back to keep alignment */
|
|
1057
1004
|
padding: 4px;
|
|
1058
1005
|
margin: -4px;
|
|
1059
|
-
`,
|
|
1006
|
+
`, Ho = v.label`
|
|
1060
1007
|
display: flex;
|
|
1061
1008
|
align-items: center;
|
|
1062
1009
|
justify-content: space-between;
|
|
1063
1010
|
gap: 12px;
|
|
1064
|
-
`,
|
|
1011
|
+
`, Jo = v(ue)`
|
|
1065
1012
|
width: 180px;
|
|
1066
|
-
`,
|
|
1013
|
+
`, zo = v(ue)`
|
|
1067
1014
|
width: 100%;
|
|
1068
1015
|
/* room for the 2px focus outline */
|
|
1069
1016
|
margin: 2px 0;
|
|
1070
|
-
`,
|
|
1017
|
+
`, Nt = /* @__PURE__ */ new Set([
|
|
1071
1018
|
"folder",
|
|
1072
1019
|
"task",
|
|
1073
1020
|
"product",
|
|
1074
1021
|
"version",
|
|
1075
1022
|
"representation",
|
|
1076
1023
|
"workfile"
|
|
1077
|
-
]),
|
|
1078
|
-
const e =
|
|
1024
|
+
]), Go = (e) => !!e && Nt.has(e), ye = y(null), Ko = () => {
|
|
1025
|
+
const e = w(ye);
|
|
1079
1026
|
if (!e)
|
|
1080
1027
|
throw new Error("useDeleteEntitiesContext must be used within a DeleteEntitiesProvider");
|
|
1081
1028
|
return e;
|
|
1082
|
-
},
|
|
1029
|
+
}, Yo = () => w(ye), Xo = "tableExport", Ot = y(null), Zo = () => w(Ot);
|
|
1083
1030
|
export {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
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,
|
|
1097
1044
|
ft as M,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
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
|
-
|
|
1045
|
+
ye as N,
|
|
1046
|
+
Xo as O,
|
|
1047
|
+
fe as P,
|
|
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,
|
|
1144
1091
|
Tt as av,
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
po as x,
|
|
1171
|
-
He as y,
|
|
1172
|
-
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
|
|
1173
1117
|
};
|