@ynput/ayon-frontend-shared 0.4.6 → 0.5.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 +686 -653
- package/dist/ListTable.es.js +11 -10
- package/dist/ProjectTreeTable.es.js +2225 -2186
- package/dist/Slicer.es.js +152 -120
- package/dist/api.es.js +202 -201
- package/dist/chunks/Actions.es.js +20 -20
- package/dist/chunks/ColumnDropIndicator.es.js +128 -242
- package/dist/chunks/DeleteEntitiesContext.es.js +37 -37
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/EntityPath.es.js +23 -23
- package/dist/chunks/EntityPickerDialog.es.js +2 -2
- package/dist/chunks/EntityTooltip.es.js +12 -12
- package/dist/chunks/Feed.es.js +16 -16
- package/dist/chunks/FilterErrorActions.es.js +5 -5
- package/dist/chunks/GlobalContext.es.js +14 -14
- package/dist/chunks/InfoMessage.es.js +146 -0
- package/dist/chunks/JsonViewer.es.js +1 -1
- package/dist/chunks/Menu.es.js +5 -5
- package/dist/chunks/MenuContext.es.js +75 -73
- package/dist/chunks/MetaWidget.es.js +1970 -1962
- package/dist/chunks/NewEntityContext.es.js +538 -543
- package/dist/chunks/PlayableIcon.es.js +54 -54
- package/dist/chunks/ProjectContext.es.js +12 -12
- package/dist/chunks/ProjectFoldersContext.es.js +84 -76
- package/dist/chunks/RepresentationsList.es.js +1 -1
- package/dist/chunks/ReviewablesSelector.es.js +390 -387
- package/dist/chunks/SimpleTable.es.js +286 -283
- package/dist/chunks/Slicer.es.js +1122 -684
- package/dist/chunks/VersionUploadContext.es.js +26 -26
- package/dist/chunks/VideoPlayer.es.js +1 -1
- package/dist/chunks/ViewsContext.es.js +31 -31
- package/dist/chunks/Watchers.es.js +2 -2
- package/dist/chunks/entityDefinitions.es.js +275 -133
- package/dist/chunks/getUris.es.js +236 -231
- package/dist/chunks/searchTerms.es.js +10 -1
- package/dist/chunks/useAttributeEnums.es.js +69 -61
- package/dist/chunks/useColumnDragRestriction.es.js +1 -1
- package/dist/chunks/useLocalStorage.es.js +11 -11
- package/dist/chunks/viewUpdateHelper.es.js +23 -23
- package/dist/components.es.js +168 -168
- package/dist/hooks.es.js +47 -46
- package/dist/index.es.js +14 -13
- package/dist/types/Actions.d.ts +7 -7
- package/dist/types/ContextMenu.d.ts +7 -7
- package/dist/types/DetailsPanel.d.ts +13 -7
- package/dist/types/EntityPickerDialog.d.ts +7 -7
- package/dist/types/Feed.d.ts +7 -7
- package/dist/types/ListTable.d.ts +7 -7
- package/dist/types/NewEntity.d.ts +7 -7
- package/dist/types/ProjectTreeTable.d.ts +35 -13
- package/dist/types/RepresentationsList.d.ts +10 -7
- package/dist/types/SimpleTable.d.ts +8 -7
- package/dist/types/Slicer.d.ts +110 -25
- package/dist/types/Views.d.ts +7 -7
- package/dist/types/api.d.ts +20 -7
- package/dist/types/components.d.ts +14 -12
- package/dist/types/context.d.ts +7 -7
- package/dist/types/hooks.d.ts +7 -7
- package/dist/types/index.d.ts +7 -7
- package/dist/types/util.d.ts +7 -7
- package/package.json +11 -1
- package/dist/chunks/useSlicerSplitter.es.js +0 -18
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as l, jsxs as z } from "react/jsx-runtime";
|
|
2
|
-
import { UserImage as K, theme as
|
|
2
|
+
import { UserImage as K, theme as S, Icon as V, Button as re, getTextColor as Ne } from "@ynput/ayon-react-components";
|
|
3
3
|
import N from "clsx";
|
|
4
|
-
import { format as P, isValid as G, isToday as Re, isSameYear as
|
|
4
|
+
import { format as P, isValid as G, isToday as Re, isSameYear as _e, isSameDay as b, isSameWeek as Le, isSameMinute as ae, formatDistanceToNow as Se, subYears as Ie, endOfYear as Z, startOfYear as J, subMonths as Oe, endOfMonth as F, startOfMonth as B, addMonths as ze, subWeeks as $e, endOfWeek as j, startOfWeek as Q, addWeeks as Fe, setHours as X, subDays as Be, endOfDay as ee, startOfDay as te, parseISO as h } from "date-fns";
|
|
5
5
|
import je from "react-markdown";
|
|
6
6
|
import Qe from "remark-gfm";
|
|
7
7
|
import Pe from "rehype-raw";
|
|
8
8
|
import ie from "turndown";
|
|
9
9
|
import s, { css as O } from "styled-components";
|
|
10
|
-
import { useState as
|
|
10
|
+
import { useState as D, useEffect as Y, useMemo as C, createContext as Ge, useContext as Ye, useRef as se, forwardRef as Ve } from "react";
|
|
11
11
|
import { Quill as ce } from "react-quill-ayon";
|
|
12
12
|
import { aP as We } from "./searchTerms.es.js";
|
|
13
|
-
import {
|
|
13
|
+
import { be as Ue, C as He, bh as Ke, aE as Ze, dc as Je, aR as Xe, aL as et, a_ as tt, K as ot, bz as nt, bg as rt, br as at } from "./getUris.es.js";
|
|
14
14
|
import "primereact/confirmdialog";
|
|
15
15
|
import { union as it, isEqual as st, isArray as ct } from "lodash";
|
|
16
16
|
import { c as le } from "./MenuContext.es.js";
|
|
@@ -219,12 +219,12 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
219
219
|
min-width: 0;
|
|
220
220
|
max-width: fit-content;
|
|
221
221
|
|
|
222
|
-
${
|
|
222
|
+
${S.bodySmall}
|
|
223
223
|
`, xt = (e) => {
|
|
224
|
-
let t =
|
|
224
|
+
let t = Se(e, { addSuffix: !0 });
|
|
225
225
|
return t = t.replace("about", ""), t = t.replace("minutes", "mins"), t = t.replace("minute", "min"), t = t.replace(" ago", ""), ae(e, /* @__PURE__ */ new Date()) && (t = "Just now"), t;
|
|
226
226
|
}, xo = ({ date: e, isExact: t, exactTooltip: o = !1, ...n }) => {
|
|
227
|
-
const [a, r] =
|
|
227
|
+
const [a, r] = D(!0), [i, d] = D(/* @__PURE__ */ new Date());
|
|
228
228
|
if (!e) return null;
|
|
229
229
|
const c = new Date(e);
|
|
230
230
|
if (!G(c)) return null;
|
|
@@ -235,8 +235,8 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
235
235
|
);
|
|
236
236
|
return () => clearInterval(v);
|
|
237
237
|
}, []);
|
|
238
|
-
const u = Re(c), y =
|
|
239
|
-
let E = a && !t ? T :
|
|
238
|
+
const u = Re(c), y = _e(c, i), m = b(c, new Date(i.setDate(i.getDate() - 1))), p = Le(c, i), g = ae(c, i), k = m ? "" : y ? p ? "E" : "MMM d" : "MMM d yyyy", x = "h:mm a", T = C(() => xt(c), [c]), M = C(() => u ? P(c, `${k}, ${x}`) : P(c, `EEEE, dd MMM yyyy ${x}`), [c, u]);
|
|
239
|
+
let E = a && !t ? T : M;
|
|
240
240
|
m && a && !t && (E = `Yesterday${E}`), g && (E = "Just now");
|
|
241
241
|
const R = () => {
|
|
242
242
|
r(!a);
|
|
@@ -249,7 +249,7 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
249
249
|
onClick: R,
|
|
250
250
|
onMouseOver: () => !o && r(!1),
|
|
251
251
|
onMouseOut: () => !o && r(!0),
|
|
252
|
-
"data-tooltip": o ?
|
|
252
|
+
"data-tooltip": o ? M : null,
|
|
253
253
|
"data-tooltip-delay": 0,
|
|
254
254
|
children: E
|
|
255
255
|
}
|
|
@@ -262,7 +262,7 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
262
262
|
projectName: a,
|
|
263
263
|
entityType: r
|
|
264
264
|
}) => {
|
|
265
|
-
const d =
|
|
265
|
+
const d = C(
|
|
266
266
|
() => e.map((v) => ({ id: v.id, projectName: v.projectName, entityType: r })),
|
|
267
267
|
[e]
|
|
268
268
|
).map((v) => v.id), c = !e.length || !t || !n || !a, u = {
|
|
@@ -281,19 +281,19 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
281
281
|
fetchNextPage: k,
|
|
282
282
|
hasNextPage: x
|
|
283
283
|
} = Ue(u, { skip: c });
|
|
284
|
-
const T =
|
|
284
|
+
const T = C(() => y?.pages ? y.pages.flatMap((v) => v.activities || []) : [], [y?.pages]), M = C(() => g?.pages ? g.pages.flatMap((v) => v.activities || []) : [], [g?.pages]), E = async () => {
|
|
285
285
|
if (!x) {
|
|
286
286
|
console.log("No more activities to load");
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
289
|
return console.log("loading next page..."), await k();
|
|
290
|
-
}, R =
|
|
290
|
+
}, R = C(() => {
|
|
291
291
|
if (!m) return !1;
|
|
292
292
|
const v = it(
|
|
293
|
-
|
|
293
|
+
M?.flatMap((_) => _.entityId ? _.entityId : [])
|
|
294
294
|
);
|
|
295
295
|
return !st(v, d);
|
|
296
|
-
}, [
|
|
296
|
+
}, [M, d, m]);
|
|
297
297
|
return c && (m = !0), {
|
|
298
298
|
activitiesData: T,
|
|
299
299
|
isLoadingActivities: m,
|
|
@@ -302,7 +302,7 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
302
302
|
hasNextPage: x,
|
|
303
303
|
loadNextPage: E
|
|
304
304
|
};
|
|
305
|
-
},
|
|
305
|
+
}, L = "no-date", q = (e, t, o, n) => [
|
|
306
306
|
{ label: o, id: e.toISOString() },
|
|
307
307
|
{ label: n, id: t.toISOString() }
|
|
308
308
|
], f = {
|
|
@@ -321,10 +321,10 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
321
321
|
},
|
|
322
322
|
"after-now": () => [
|
|
323
323
|
{ label: "After today", id: X(/* @__PURE__ */ new Date(), 24).toISOString() },
|
|
324
|
-
{ id:
|
|
324
|
+
{ id: L, label: L }
|
|
325
325
|
],
|
|
326
326
|
"before-now": () => [
|
|
327
|
-
{ id:
|
|
327
|
+
{ id: L, label: L },
|
|
328
328
|
{ label: "Before today", id: X(/* @__PURE__ */ new Date(), 0).toISOString() }
|
|
329
329
|
],
|
|
330
330
|
"this-week": () => {
|
|
@@ -455,10 +455,10 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
455
455
|
values: f["last-year"](),
|
|
456
456
|
icon: "calendar_month"
|
|
457
457
|
}
|
|
458
|
-
], Eo = de(),
|
|
458
|
+
], Eo = de(), Mt = () => [
|
|
459
459
|
Tt,
|
|
460
460
|
...de()
|
|
461
|
-
], qo =
|
|
461
|
+
], qo = Mt(), Ao = (e, t) => {
|
|
462
462
|
if (!e || !t) return null;
|
|
463
463
|
try {
|
|
464
464
|
const o = h(e), n = h(t);
|
|
@@ -536,13 +536,13 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
536
536
|
} catch {
|
|
537
537
|
return null;
|
|
538
538
|
}
|
|
539
|
-
}, W = "relative:",
|
|
539
|
+
}, W = "relative:", Ct = (e) => typeof e == "string" && e.startsWith(W), Dt = (e) => {
|
|
540
540
|
const t = e.replace(W, "").split(":");
|
|
541
541
|
if (t.length !== 2) return null;
|
|
542
542
|
const o = t[0], n = parseInt(t[1], 10);
|
|
543
543
|
return !(o in f) || isNaN(n) ? null : { patternId: o, index: n };
|
|
544
544
|
}, Nt = (e) => {
|
|
545
|
-
const t =
|
|
545
|
+
const t = Dt(e);
|
|
546
546
|
return t ? f[t.patternId]()[t.index]?.id ?? e : e;
|
|
547
547
|
}, To = (e, t) => `${W}${e}:${t}`, ue = (e) => {
|
|
548
548
|
if (!e.conditions || e.conditions.length === 0)
|
|
@@ -550,17 +550,17 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
550
550
|
const t = e.conditions.map((o) => {
|
|
551
551
|
if ("key" in o) {
|
|
552
552
|
const n = o;
|
|
553
|
-
return
|
|
553
|
+
return Ct(n.value) ? { ...n, value: Nt(n.value) } : n;
|
|
554
554
|
} else
|
|
555
555
|
return ue(o);
|
|
556
556
|
});
|
|
557
557
|
return { ...e, conditions: t };
|
|
558
|
-
}, Rt = new Set(Object.keys(He).filter((e) => e !== "activity")),
|
|
558
|
+
}, Rt = new Set(Object.keys(He).filter((e) => e !== "activity")), _t = {
|
|
559
559
|
has_attachments: "activity_data.files",
|
|
560
560
|
// not `entity_type`: on inbox rows that column is always 'user'
|
|
561
561
|
origin_type: "activity_data.origin.type"
|
|
562
|
-
},
|
|
563
|
-
const t =
|
|
562
|
+
}, Lt = (e) => !!e && "key" in e, St = (e) => {
|
|
563
|
+
const t = _t[e.key] ?? e.key;
|
|
564
564
|
if (e.key === "has_attachments")
|
|
565
565
|
return e.value ? { key: t, operator: "ne", value: [] } : null;
|
|
566
566
|
if (e.key === "in_review_session")
|
|
@@ -587,8 +587,8 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
587
587
|
]
|
|
588
588
|
} : { ...e, key: t };
|
|
589
589
|
}, pe = (e) => {
|
|
590
|
-
if (
|
|
591
|
-
return Rt.has(e.key) ? null :
|
|
590
|
+
if (Lt(e))
|
|
591
|
+
return Rt.has(e.key) ? null : St(e);
|
|
592
592
|
const t = (e.conditions || []).map((o) => pe(o)).filter((o) => o !== null);
|
|
593
593
|
return t.length === 0 ? null : { operator: e.operator || "and", conditions: t };
|
|
594
594
|
}, It = (e) => {
|
|
@@ -599,17 +599,17 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
599
599
|
const t = It(e);
|
|
600
600
|
if (t)
|
|
601
601
|
return JSON.stringify(t);
|
|
602
|
-
},
|
|
602
|
+
}, Mo = "__new__", me = Ge(void 0), Co = ({ children: e, ...t }) => {
|
|
603
603
|
const { isGuest: o } = le(), { data: n = [] } = Ke({ projects: [t.projectName] }), { data: a = [] } = We.useGetTeamsQuery(
|
|
604
604
|
{ projectName: t.projectName, showMembers: !0 },
|
|
605
605
|
{ skip: !t.projectName }
|
|
606
|
-
), r =
|
|
607
|
-
() => a.filter((w) => w.members?.some((
|
|
606
|
+
), r = C(
|
|
607
|
+
() => a.filter((w) => w.members?.some((De) => De.name === t.userName)).map((w) => w.name),
|
|
608
608
|
[a, t.userName]
|
|
609
|
-
), [i, d] =
|
|
609
|
+
), [i, d] = D({
|
|
610
610
|
operator: "and",
|
|
611
611
|
conditions: []
|
|
612
|
-
}), [c, u] =
|
|
612
|
+
}), [c, u] = D(""), y = t.feedFilter ?? i, m = t.setFeedFilter ?? d, [p, g] = D(null), [k, x] = D(null), [T, { isLoading: M }] = Ze(), [E, { isLoading: R }] = Je(), [v, { isLoading: _ }] = Xe(), ye = M || R || _, be = async (w) => await T(w).unwrap(), ve = async (w) => await E(w).unwrap(), we = async (w) => await v(w).unwrap(), [ke] = et(), [xe] = tt(), Ee = async (w) => await ke(w).unwrap(), qe = async (w) => await xe(w).unwrap(), U = ot(y), H = C(() => Ot(y), [y]), Ae = Et({
|
|
613
613
|
entities: t.entities,
|
|
614
614
|
filter: y,
|
|
615
615
|
backendFilter: H,
|
|
@@ -625,9 +625,9 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
625
625
|
projectName: t.projectName
|
|
626
626
|
},
|
|
627
627
|
{ skip: !p }
|
|
628
|
-
), { data:
|
|
628
|
+
), { data: Me = [] } = rt({
|
|
629
629
|
projectName: t.projectName
|
|
630
|
-
}), { data:
|
|
630
|
+
}), { data: Ce } = at(
|
|
631
631
|
{
|
|
632
632
|
projectName: t.projectName,
|
|
633
633
|
entityIds: t.entities.map((w) => w.id)
|
|
@@ -641,8 +641,8 @@ const ht = (e) => e.replaceAll("<p>", "").replaceAll("</p>", `
|
|
|
641
641
|
...t,
|
|
642
642
|
...Ae,
|
|
643
643
|
mentionSuggestionsData: Te,
|
|
644
|
-
categories:
|
|
645
|
-
checklistCount:
|
|
644
|
+
categories: Me,
|
|
645
|
+
checklistCount: Ce,
|
|
646
646
|
users: n,
|
|
647
647
|
isUpdatingActivity: ye,
|
|
648
648
|
userTeamNames: r,
|
|
@@ -704,7 +704,7 @@ class $ extends Ft {
|
|
|
704
704
|
}
|
|
705
705
|
$.sanitize = (e) => e;
|
|
706
706
|
ce.register($, !0);
|
|
707
|
-
const
|
|
707
|
+
const Do = ({ projectName: e, editorRef: t }) => {
|
|
708
708
|
const { openSlideOut: o } = le(), [, n] = $t(), a = se(null);
|
|
709
709
|
a.current = {
|
|
710
710
|
onClick: (r, i) => {
|
|
@@ -951,7 +951,7 @@ const Co = ({ projectName: e, editorRef: t }) => {
|
|
|
951
951
|
]
|
|
952
952
|
}
|
|
953
953
|
);
|
|
954
|
-
},
|
|
954
|
+
}, _o = s.div`
|
|
955
955
|
/* use grid tick for auto height transition */
|
|
956
956
|
display: grid;
|
|
957
957
|
height: 100%;
|
|
@@ -979,7 +979,7 @@ const Co = ({ projectName: e, editorRef: t }) => {
|
|
|
979
979
|
--button-color-secondary: ${t};
|
|
980
980
|
--button-text-color: ${Ne(e)};
|
|
981
981
|
--border-color: ${e};
|
|
982
|
-
`,
|
|
982
|
+
`, Lo = s.div`
|
|
983
983
|
/* VARS */
|
|
984
984
|
--background-color: var(--md-sys-color-surface-container);
|
|
985
985
|
--button-color: var(--md-sys-color-primary);
|
|
@@ -1320,7 +1320,7 @@ const Co = ({ projectName: e, editorRef: t }) => {
|
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
|
-
`,
|
|
1323
|
+
`, So = s.footer`
|
|
1324
1324
|
display: flex;
|
|
1325
1325
|
justify-content: space-between;
|
|
1326
1326
|
padding: var(--padding-m);
|
|
@@ -1546,17 +1546,17 @@ const Po = s.li`
|
|
|
1546
1546
|
}
|
|
1547
1547
|
|
|
1548
1548
|
h1 {
|
|
1549
|
-
${
|
|
1549
|
+
${S.titleLarge}
|
|
1550
1550
|
font-size: 24px;
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
1553
|
h2 {
|
|
1554
|
-
${
|
|
1554
|
+
${S.titleMedium}
|
|
1555
1555
|
font-size: 20px;
|
|
1556
1556
|
}
|
|
1557
1557
|
|
|
1558
1558
|
h3 {
|
|
1559
|
-
${
|
|
1559
|
+
${S.titleSmall}
|
|
1560
1560
|
font-size: 16px;
|
|
1561
1561
|
}
|
|
1562
1562
|
|
|
@@ -1805,7 +1805,7 @@ const Wt = s.pre`
|
|
|
1805
1805
|
onClick: () => {
|
|
1806
1806
|
p !== "user" && p !== "team" && i({ entityId: g, entityType: p, projectName: r, activityId: d });
|
|
1807
1807
|
},
|
|
1808
|
-
onMouseEnter: (
|
|
1808
|
+
onMouseEnter: (M, E) => c({ type: p, id: T, label: k, name: g, pos: E }),
|
|
1809
1809
|
categoryPrimary: u,
|
|
1810
1810
|
categorySecondary: y,
|
|
1811
1811
|
"data-mention-value": `${p}:${g}`,
|
|
@@ -1879,7 +1879,7 @@ export {
|
|
|
1879
1879
|
At as C,
|
|
1880
1880
|
jt as D,
|
|
1881
1881
|
zo as E,
|
|
1882
|
-
|
|
1882
|
+
Mo as F,
|
|
1883
1883
|
Bo as G,
|
|
1884
1884
|
Yt as H,
|
|
1885
1885
|
wo as I,
|
|
@@ -1887,7 +1887,7 @@ export {
|
|
|
1887
1887
|
Go as K,
|
|
1888
1888
|
Qo as L,
|
|
1889
1889
|
Oo as M,
|
|
1890
|
-
|
|
1890
|
+
L as N,
|
|
1891
1891
|
Vo as O,
|
|
1892
1892
|
Jo as P,
|
|
1893
1893
|
No as Q,
|
|
@@ -1901,7 +1901,7 @@ export {
|
|
|
1901
1901
|
Zo as Y,
|
|
1902
1902
|
Ko as Z,
|
|
1903
1903
|
Ho as _,
|
|
1904
|
-
|
|
1904
|
+
Co as a,
|
|
1905
1905
|
vt as a0,
|
|
1906
1906
|
qt as b,
|
|
1907
1907
|
To as c,
|
|
@@ -1910,10 +1910,10 @@ export {
|
|
|
1910
1910
|
vo as f,
|
|
1911
1911
|
de as g,
|
|
1912
1912
|
qo as h,
|
|
1913
|
-
|
|
1913
|
+
Ct as i,
|
|
1914
1914
|
Eo as j,
|
|
1915
1915
|
f as k,
|
|
1916
|
-
|
|
1916
|
+
Mt as l,
|
|
1917
1917
|
ue as m,
|
|
1918
1918
|
ko as n,
|
|
1919
1919
|
Ut as o,
|
|
@@ -1921,11 +1921,11 @@ export {
|
|
|
1921
1921
|
Ro as q,
|
|
1922
1922
|
Nt as r,
|
|
1923
1923
|
$t as s,
|
|
1924
|
-
|
|
1924
|
+
Do as t,
|
|
1925
1925
|
zt as u,
|
|
1926
1926
|
jo as v,
|
|
1927
|
-
|
|
1928
|
-
|
|
1927
|
+
_o as w,
|
|
1928
|
+
Lo as x,
|
|
1929
1929
|
$o as y,
|
|
1930
|
-
|
|
1930
|
+
So as z
|
|
1931
1931
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as B } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as E, useCallback as a, useContext as T } from "react";
|
|
3
3
|
import "./searchTerms.es.js";
|
|
4
|
-
import {
|
|
4
|
+
import { c1 as G, b_ as Q, dx as _ } from "./getUris.es.js";
|
|
5
5
|
import "primereact/confirmdialog";
|
|
6
6
|
import "lodash";
|
|
7
7
|
import "react-toastify";
|
|
8
8
|
import { g as l } from "./getEntityTypeIcon.es.js";
|
|
9
9
|
import "uuid";
|
|
10
|
-
const
|
|
10
|
+
const F = {
|
|
11
11
|
name: "",
|
|
12
12
|
code: "",
|
|
13
13
|
productTypes: [],
|
|
@@ -25,7 +25,7 @@ const L = {
|
|
|
25
25
|
linkTypes: [],
|
|
26
26
|
ownAttrib: []
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function L(t) {
|
|
29
29
|
if (!t)
|
|
30
30
|
return { productTypes: [], productBaseTypes: [] };
|
|
31
31
|
const i = t.productTypes || [], o = /* @__PURE__ */ new Map();
|
|
@@ -40,7 +40,7 @@ function M(t) {
|
|
|
40
40
|
productBaseTypes: Array.from(o.values())
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
const p = E(void 0),
|
|
43
|
+
const p = E(void 0), J = ({
|
|
44
44
|
projectName: t,
|
|
45
45
|
children: i
|
|
46
46
|
}) => {
|
|
@@ -55,12 +55,12 @@ const p = E(void 0), H = ({
|
|
|
55
55
|
} = G({ projectName: t }, { skip: !t }), { data: d = {}, refetch: y } = Q(
|
|
56
56
|
{ projectName: t },
|
|
57
57
|
{ skip: !t }
|
|
58
|
-
), s = d.product_base_types?.default, { data: g } =
|
|
58
|
+
), s = d.product_base_types?.default, { data: g } = _(
|
|
59
59
|
{ projectName: t },
|
|
60
60
|
{
|
|
61
61
|
skip: !t
|
|
62
62
|
}
|
|
63
|
-
), { productTypes: n, productBaseTypes: x } =
|
|
63
|
+
), { productTypes: n, productBaseTypes: x } = L(g), h = a(
|
|
64
64
|
(c) => o?.folderTypes?.find((e) => e.name === c),
|
|
65
65
|
[o]
|
|
66
66
|
), v = a(
|
|
@@ -93,7 +93,7 @@ const p = E(void 0), H = ({
|
|
|
93
93
|
p.Provider,
|
|
94
94
|
{
|
|
95
95
|
value: {
|
|
96
|
-
...
|
|
96
|
+
...F,
|
|
97
97
|
...o,
|
|
98
98
|
projectName: t,
|
|
99
99
|
productTypes: n,
|
|
@@ -108,14 +108,14 @@ const p = E(void 0), H = ({
|
|
|
108
108
|
children: i
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
|
-
},
|
|
111
|
+
}, K = () => {
|
|
112
112
|
const t = T(p);
|
|
113
113
|
if (t === void 0)
|
|
114
114
|
throw new Error("useProjectContext must be used within a ProjectContextProvider");
|
|
115
115
|
return t;
|
|
116
|
-
},
|
|
116
|
+
}, R = () => T(p);
|
|
117
117
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
J as P,
|
|
119
|
+
K as a,
|
|
120
|
+
R as u
|
|
121
121
|
};
|
|
@@ -1,90 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as k, useState as z, useEffect as B, useMemo as a, useContext as E } from "react";
|
|
3
3
|
import "./searchTerms.es.js";
|
|
4
|
-
import {
|
|
4
|
+
import { bI as N } from "./getUris.es.js";
|
|
5
5
|
import "primereact/confirmdialog";
|
|
6
|
-
import { P as
|
|
7
|
-
const Q = (
|
|
8
|
-
const d =
|
|
9
|
-
return
|
|
10
|
-
const
|
|
11
|
-
!
|
|
12
|
-
}, [Object.values(
|
|
13
|
-
},
|
|
14
|
-
projectName:
|
|
15
|
-
children:
|
|
6
|
+
import { P as y } from "./ProjectFoldersContextInstance.es.js";
|
|
7
|
+
const Q = (s, h) => {
|
|
8
|
+
const d = k(null), [b, l] = z(!1);
|
|
9
|
+
return B(() => {
|
|
10
|
+
const u = d.current;
|
|
11
|
+
!u || Object.keys(s).some((c) => u[c] !== s[c]) || Object.keys(u).some((c) => u[c] !== s[c]) ? (d.current = { ...s }, l(h)) : h || l(!1);
|
|
12
|
+
}, [Object.values(s).join(","), h]), b;
|
|
13
|
+
}, H = ({
|
|
14
|
+
projectName: s,
|
|
15
|
+
children: h
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
18
|
data: { folders: d = [] } = {},
|
|
19
19
|
isLoading: b,
|
|
20
20
|
isFetching: l,
|
|
21
|
-
isSuccess:
|
|
21
|
+
isSuccess: u,
|
|
22
22
|
isUninitialized: w,
|
|
23
23
|
error: c,
|
|
24
24
|
refetch: S
|
|
25
|
-
} = N({ projectName:
|
|
26
|
-
const
|
|
27
|
-
for (const
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
}, [d]),
|
|
31
|
-
() => (
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
for (; o.size > 0 &&
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
for (const
|
|
41
|
-
|
|
42
|
-
([O]) => O ===
|
|
43
|
-
)?.[1], o.delete(
|
|
44
|
-
|
|
25
|
+
} = N({ projectName: s, attrib: !0 }), F = Q({ projectName: s }, l || b), f = a(() => {
|
|
26
|
+
const e = /* @__PURE__ */ new Map();
|
|
27
|
+
for (const t of d)
|
|
28
|
+
e.set(t.id, t);
|
|
29
|
+
return e;
|
|
30
|
+
}, [d]), P = a(() => (e) => f.get(e), [f]), C = a(
|
|
31
|
+
() => (e, t, n = {}) => {
|
|
32
|
+
if (!t.length) return {};
|
|
33
|
+
const r = {}, o = new Set(t), p = /* @__PURE__ */ new Set();
|
|
34
|
+
let g = e;
|
|
35
|
+
for (; o.size > 0 && g && !p.has(g); ) {
|
|
36
|
+
p.add(g);
|
|
37
|
+
const i = f.get(g);
|
|
38
|
+
if (!i) break;
|
|
39
|
+
const L = i.attrib || {};
|
|
40
|
+
for (const m of Array.from(o))
|
|
41
|
+
i.ownAttrib?.includes(m) && m in L && (r[m] = Object.entries(L).find(
|
|
42
|
+
([O]) => O === m
|
|
43
|
+
)?.[1], o.delete(m));
|
|
44
|
+
g = i.parentId;
|
|
45
45
|
}
|
|
46
|
-
for (const
|
|
47
|
-
|
|
48
|
-
for (const
|
|
49
|
-
|
|
50
|
-
return
|
|
46
|
+
for (const i of Array.from(o))
|
|
47
|
+
i in n && (r[i] = n[i], o.delete(i));
|
|
48
|
+
for (const i of o)
|
|
49
|
+
r[i] = null;
|
|
50
|
+
return r;
|
|
51
51
|
},
|
|
52
52
|
[f]
|
|
53
|
-
), I =
|
|
54
|
-
() => (
|
|
55
|
-
const
|
|
56
|
-
let
|
|
57
|
-
for (;
|
|
58
|
-
|
|
59
|
-
const o = f.get(
|
|
53
|
+
), I = a(
|
|
54
|
+
() => (e) => {
|
|
55
|
+
const t = [], n = /* @__PURE__ */ new Set();
|
|
56
|
+
let r = e;
|
|
57
|
+
for (; r && !n.has(r); ) {
|
|
58
|
+
n.add(r);
|
|
59
|
+
const o = f.get(r);
|
|
60
60
|
if (!o?.parentId) break;
|
|
61
|
-
|
|
61
|
+
t.push(o.parentId), r = o.parentId;
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return t;
|
|
64
64
|
},
|
|
65
65
|
[f]
|
|
66
|
-
), v =
|
|
67
|
-
() => (
|
|
68
|
-
const
|
|
69
|
-
return
|
|
66
|
+
), v = a(
|
|
67
|
+
() => (e) => {
|
|
68
|
+
const t = new Set(e);
|
|
69
|
+
return e.filter((n) => !I(n).some((r) => t.has(r)));
|
|
70
70
|
},
|
|
71
71
|
[I]
|
|
72
|
-
),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
), x = a(() => {
|
|
73
|
+
const e = /* @__PURE__ */ new Map();
|
|
74
|
+
for (const t of d) {
|
|
75
|
+
if (!t.parentId) continue;
|
|
76
|
+
const n = e.get(t.parentId);
|
|
77
|
+
n ? n.push(t.id) : e.set(t.parentId, [t.id]);
|
|
78
|
+
}
|
|
79
|
+
return e;
|
|
80
|
+
}, [d]), j = a(
|
|
81
|
+
() => (e, t = !1) => {
|
|
82
|
+
const n = t ? [...e] : [], r = [...e];
|
|
83
|
+
for (; r.length > 0; ) {
|
|
84
|
+
const o = r.shift();
|
|
85
|
+
for (const p of x.get(o) || [])
|
|
86
|
+
n.push(p), r.push(p);
|
|
79
87
|
}
|
|
80
|
-
return
|
|
88
|
+
return n;
|
|
81
89
|
},
|
|
82
|
-
[
|
|
83
|
-
),
|
|
90
|
+
[x]
|
|
91
|
+
), A = () => S().unwrap(), M = a(
|
|
84
92
|
() => ({
|
|
85
93
|
folders: d,
|
|
86
|
-
getFolderById:
|
|
87
|
-
findNonInheritedValues:
|
|
94
|
+
getFolderById: P,
|
|
95
|
+
findNonInheritedValues: C,
|
|
88
96
|
getParentFolderIds: I,
|
|
89
97
|
getFolderIdsWithoutChildren: v,
|
|
90
98
|
getChildFolderIds: j,
|
|
@@ -92,35 +100,35 @@ const Q = (n, p) => {
|
|
|
92
100
|
// first time and when args change
|
|
93
101
|
isFetching: l,
|
|
94
102
|
// any background fetching
|
|
95
|
-
isSuccess:
|
|
103
|
+
isSuccess: u,
|
|
96
104
|
isUninitialized: w,
|
|
97
105
|
error: c,
|
|
98
|
-
refetch:
|
|
106
|
+
refetch: A
|
|
99
107
|
}),
|
|
100
108
|
[
|
|
101
109
|
d,
|
|
102
|
-
C,
|
|
103
110
|
P,
|
|
111
|
+
C,
|
|
104
112
|
I,
|
|
105
113
|
v,
|
|
106
114
|
j,
|
|
107
115
|
F,
|
|
108
116
|
l,
|
|
109
|
-
|
|
117
|
+
u,
|
|
110
118
|
w,
|
|
111
119
|
c,
|
|
112
|
-
|
|
120
|
+
A
|
|
113
121
|
]
|
|
114
122
|
);
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
},
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
123
|
+
return /* @__PURE__ */ R(y.Provider, { value: M, children: h });
|
|
124
|
+
}, J = () => {
|
|
125
|
+
const s = E(y);
|
|
126
|
+
if (s === void 0)
|
|
119
127
|
throw new Error("useProjectFoldersContext must be used within a ProjectFoldersContextProvider");
|
|
120
|
-
return
|
|
128
|
+
return s;
|
|
121
129
|
};
|
|
122
130
|
export {
|
|
123
|
-
|
|
131
|
+
H as P,
|
|
124
132
|
Q as a,
|
|
125
|
-
|
|
133
|
+
J as u
|
|
126
134
|
};
|
|
@@ -12,7 +12,7 @@ import "uuid";
|
|
|
12
12
|
import "./searchTerms.es.js";
|
|
13
13
|
import { a as E } from "./useCreateContextMenu.es.js";
|
|
14
14
|
import { D as F } from "./DetailsDialog.es.js";
|
|
15
|
-
import {
|
|
15
|
+
import { b_ as H } from "./getUris.es.js";
|
|
16
16
|
const I = (d = []) => {
|
|
17
17
|
let n = [];
|
|
18
18
|
for (const t of d) {
|