@ynput/ayon-frontend-shared 0.7.6 → 0.8.1
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 +361 -355
- package/dist/Feed.es.js +1 -1
- package/dist/ListTable.es.js +18 -18
- package/dist/NewEntity.es.js +30 -30
- package/dist/ProjectTreeTable.es.js +984 -974
- package/dist/ProjectsTable.es.js +3 -3
- package/dist/Slicer.es.js +53 -50
- package/dist/Views.es.js +150 -151
- package/dist/api.es.js +166 -165
- package/dist/chunks/Actions.es.js +9 -10
- package/dist/chunks/ColumnDropIndicator.es.js +2 -2
- package/dist/chunks/ColumnHeaderMenuUI.es.js +3 -4
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/EmptyPlaceholder.es.js +7 -7
- package/dist/chunks/EntityPath.es.js +38 -39
- package/dist/chunks/EntityPickerDialog.es.js +65 -66
- package/dist/chunks/EntityTooltip.es.js +18 -19
- package/dist/chunks/Feed.es.js +1381 -1355
- package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
- package/dist/chunks/FilterErrorActions.es.js +2 -3
- package/dist/chunks/GroupSettingsFallback.es.js +2 -2
- package/dist/chunks/Menu.es.js +52 -53
- package/dist/chunks/MetaWidget.es.js +1948 -1875
- package/dist/chunks/ProjectFoldersContext.es.js +40 -40
- package/dist/chunks/RepresentationsList.es.js +1 -1
- package/dist/chunks/ReviewablesSelector.es.js +759 -742
- package/dist/chunks/SimpleTable.es.js +2 -1
- package/dist/chunks/Slicer.es.js +49 -50
- package/dist/chunks/TableExportContextInstance.es.js +600 -402
- package/dist/chunks/TableSettingsFallback.es.js +3 -4
- package/dist/chunks/ThumbnailSimple.es.js +114 -99
- package/dist/chunks/VideoPlayer.es.js +8 -9
- package/dist/chunks/Watchers.es.js +928 -871
- package/dist/chunks/expandRelativeDates.es.js +1 -1
- package/dist/chunks/getThumbnailUrl.es.js +33 -21
- package/dist/chunks/getUris.es.js +1580 -1610
- package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
- package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
- package/dist/chunks/searchTerms.es.js +774 -696
- package/dist/chunks/useAttributeEnums.es.js +22 -22
- package/dist/chunks/useDateRangeFilter.es.js +1 -1
- package/dist/chunks/useHierarchySelection.es.js +3 -4
- package/dist/chunks/useLoadModule.es.js +3 -4
- package/dist/components.es.js +1261 -1206
- package/dist/context.es.js +615 -540
- package/dist/hooks.es.js +193 -171
- package/dist/index.es.js +2 -2
- package/dist/types/Actions.d.ts +10 -8
- package/dist/types/DetailsPanel.d.ts +54 -76
- package/dist/types/EntityPickerDialog.d.ts +12 -6
- package/dist/types/Feed.d.ts +24 -24
- package/dist/types/ListTable.d.ts +33 -27
- package/dist/types/NewEntity.d.ts +26 -39
- package/dist/types/ProjectTreeTable.d.ts +275 -194
- package/dist/types/ProjectsTable.d.ts +6 -6
- package/dist/types/RepresentationsList.d.ts +4 -0
- package/dist/types/Slicer.d.ts +63 -246
- package/dist/types/Views.d.ts +71 -298
- package/dist/types/api.d.ts +3165 -2363
- package/dist/types/components.d.ts +444 -473
- package/dist/types/context.d.ts +285 -572
- package/dist/types/hooks.d.ts +76 -47
- package/dist/types/index.d.ts +6 -0
- package/dist/types/util.d.ts +141 -120
- package/dist/util.es.js +71 -68
- package/package.json +6 -6
- package/dist/chunks/EntityUpdatesContext.es.js +0 -61
- package/dist/chunks/PlayableIcon.es.js +0 -5020
- package/dist/chunks/viewUpdateHelper.es.js +0 -153
package/dist/Feed.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import N from "clsx";
|
|
|
5
5
|
import { Icon as z } from "@ynput/ayon-react-components";
|
|
6
6
|
import { e as J, D as Q, S as Y } from "./chunks/Feed.es.js";
|
|
7
7
|
import { A as gt, C as vt, a as mt, b as yt, F as pt, c as ht, d as xt, f as It, i as bt, g as At, r as wt } from "./chunks/Feed.es.js";
|
|
8
|
-
import { b as Et, c as Dt, i as Tt } from "./chunks/
|
|
8
|
+
import { b as Et, c as Dt, i as Tt } from "./chunks/FilmstripEntityCard.es.js";
|
|
9
9
|
const Z = ({ files: c, index: t, activityId: s, onNavigate: e }) => {
|
|
10
10
|
const n = c, o = t, u = s, l = () => n[0].id != u, a = () => n[n.length - 1].id != u, r = () => o > 0 || l(), I = () => o < n.find((i) => i.id == u).files.length - 1 || a(), v = () => n[n.findIndex((i) => i.id == u) - 1], y = () => n[n.findIndex((i) => i.id == u) + 1], f = () => v().id, d = () => y().id;
|
|
11
11
|
return {
|
package/dist/ListTable.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import Gt, { useState as L, useEffect as Mt, useRef as At, useCallback as O, use
|
|
|
3
3
|
import A from "clsx";
|
|
4
4
|
import { flexRender as nt, useReactTable as Ee, getSortedRowModel as Re, getExpandedRowModel as Se, getCoreRowModel as we } from "@tanstack/react-table";
|
|
5
5
|
import { Button as ze, Icon as Ie } from "@ynput/ayon-react-components";
|
|
6
|
-
import "./chunks/
|
|
6
|
+
import "./chunks/FilmstripEntityCard.es.js";
|
|
7
7
|
import "date-fns";
|
|
8
8
|
import { D as Te, B as Ve, T as _e, E as ke, j as Le } from "./chunks/MetaWidget.es.js";
|
|
9
9
|
import "react-toastify";
|
|
@@ -22,7 +22,7 @@ import "@lexical/selection";
|
|
|
22
22
|
import "@lexical/utils";
|
|
23
23
|
import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
24
24
|
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
25
|
-
import {
|
|
25
|
+
import { dK as vt, dL as Me } from "./chunks/getUris.es.js";
|
|
26
26
|
import { u as Ae } from "./chunks/TableExportContextInstance.es.js";
|
|
27
27
|
import "@ynput/ayon-addon";
|
|
28
28
|
import "@module-federation/enhanced/runtime";
|
|
@@ -30,8 +30,8 @@ import "@ynput/ayon-addon/host";
|
|
|
30
30
|
import "semver";
|
|
31
31
|
import { u as He } from "./chunks/useCreateContextMenu.es.js";
|
|
32
32
|
import "react-dom";
|
|
33
|
-
import "react-redux";
|
|
34
33
|
import "react-router-dom";
|
|
34
|
+
import "react-redux";
|
|
35
35
|
import { useVirtualizer as Oe } from "@tanstack/react-virtual";
|
|
36
36
|
import { useSensors as $e, useSensor as Ct, PointerSensor as Ne, KeyboardSensor as je, DndContext as xt, closestCenter as Dt, DragOverlay as Et, defaultDropAnimationSideEffects as Rt } from "@dnd-kit/core";
|
|
37
37
|
import { restrictToHorizontalAxis as Ke, restrictToVerticalAxis as We } from "@dnd-kit/modifiers";
|
|
@@ -44,7 +44,7 @@ import "./chunks/Menu.es.js";
|
|
|
44
44
|
import "./chunks/EmptyPlaceholder.es.js";
|
|
45
45
|
import "./chunks/EmptyPlaceholderFlex.styled.es.js";
|
|
46
46
|
import "./chunks/InfoMessage.es.js";
|
|
47
|
-
import { C as
|
|
47
|
+
import { C as Xe } from "./chunks/ColumnHeaderMenuUI.es.js";
|
|
48
48
|
import "primereact-context/contextmenu";
|
|
49
49
|
const $t = v.tr`
|
|
50
50
|
display: flex;
|
|
@@ -168,7 +168,7 @@ const $t = v.tr`
|
|
|
168
168
|
cursor: pointer;
|
|
169
169
|
box-sizing: border-box;
|
|
170
170
|
min-width: 0;
|
|
171
|
-
`,
|
|
171
|
+
`, Je = v.div`
|
|
172
172
|
display: flex;
|
|
173
173
|
align-items: center;
|
|
174
174
|
width: 100%;
|
|
@@ -580,7 +580,7 @@ const It = v.tbody`
|
|
|
580
580
|
zt,
|
|
581
581
|
{
|
|
582
582
|
style: { left: 0, paddingLeft: `calc(var(--padding-m) + ${t.depth * 16}px)` },
|
|
583
|
-
children: /* @__PURE__ */ a(
|
|
583
|
+
children: /* @__PURE__ */ a(Je, { children: l })
|
|
584
584
|
}
|
|
585
585
|
) }, `${t.id}-placeholder`);
|
|
586
586
|
}
|
|
@@ -835,7 +835,7 @@ function In({
|
|
|
835
835
|
children: [
|
|
836
836
|
/* @__PURE__ */ a(pn, { children: t.isPlaceholder ? null : nt(t.column.columnDef.header, t.getContext()) }),
|
|
837
837
|
(y.length > 0 || C) && /* @__PURE__ */ M(mn, { ...B, children: [
|
|
838
|
-
y.length > 0 && /* @__PURE__ */ a(
|
|
838
|
+
y.length > 0 && /* @__PURE__ */ a(Xe, { menuItems: y, menuId: f, className: "header-menu" }),
|
|
839
839
|
C && /* @__PURE__ */ a(
|
|
840
840
|
Ue,
|
|
841
841
|
{
|
|
@@ -1038,16 +1038,16 @@ function Lo({
|
|
|
1038
1038
|
sorting: Bt,
|
|
1039
1039
|
onSortingChange: Yt,
|
|
1040
1040
|
enableExpanding: Ut = !0,
|
|
1041
|
-
expanded:
|
|
1042
|
-
onExpandedChange:
|
|
1041
|
+
expanded: Xt,
|
|
1042
|
+
onExpandedChange: Jt,
|
|
1043
1043
|
getIsRowInactive: ot
|
|
1044
1044
|
}) {
|
|
1045
1045
|
const [qt, Qt] = L([]), [Zt, te] = L({}), [ee, ne] = L({}), [oe, ie] = L({}), Y = At(null), [it] = He(), rt = Bt ?? qt, re = (o) => {
|
|
1046
1046
|
const p = typeof o == "function" ? o(rt) : o;
|
|
1047
1047
|
Qt(p), Yt?.(p);
|
|
1048
|
-
}, st =
|
|
1048
|
+
}, st = Xt ?? oe, se = (o) => {
|
|
1049
1049
|
const p = typeof o == "function" ? o(st) : o;
|
|
1050
|
-
ie(p),
|
|
1050
|
+
ie(p), Jt?.(p);
|
|
1051
1051
|
}, U = S ?? Zt, ae = (o) => {
|
|
1052
1052
|
const p = typeof o == "function" ? o(at) : o, D = {};
|
|
1053
1053
|
Object.keys(p).forEach((I) => {
|
|
@@ -1099,17 +1099,17 @@ function Lo({
|
|
|
1099
1099
|
updateData: s,
|
|
1100
1100
|
openViewerDialog: m
|
|
1101
1101
|
}
|
|
1102
|
-
}), { rows: _ } = N.getRowModel(),
|
|
1102
|
+
}), { rows: _ } = N.getRowModel(), X = Oe({
|
|
1103
1103
|
count: i ? _.length + 1 : _.length,
|
|
1104
1104
|
getScrollElement: () => Y.current,
|
|
1105
1105
|
estimateSize: () => 44,
|
|
1106
1106
|
overscan: 10
|
|
1107
|
-
}),
|
|
1107
|
+
}), J = X.getVirtualItems(), { handleRowClick: de, handleKeyDown: ce } = Vn({
|
|
1108
1108
|
rows: _,
|
|
1109
1109
|
selectedRows: d,
|
|
1110
1110
|
onSelectedRowsChange: C,
|
|
1111
1111
|
multiSelection: g,
|
|
1112
|
-
rowVirtualizer:
|
|
1112
|
+
rowVirtualizer: X,
|
|
1113
1113
|
tableContainerRef: Y
|
|
1114
1114
|
}), ue = O(
|
|
1115
1115
|
(o, p, D) => {
|
|
@@ -1165,9 +1165,9 @@ function Lo({
|
|
|
1165
1165
|
handleRowDragCancel: ye
|
|
1166
1166
|
} = kn({ rows: _, columnOrder: dt, onReorderRows: E, setColumnOrder: ct, onColumnOrderChange: z }), ft = tt(() => ({ onUpdateRow: s, onOpenViewer: m }), [s, m]), ve = Ln(N), Ce = !!N.getState().columnSizingInfo.isResizingColumn;
|
|
1167
1167
|
Mt(() => {
|
|
1168
|
-
const [o] =
|
|
1168
|
+
const [o] = J.slice(-1);
|
|
1169
1169
|
o && o.index >= _.length - 1 && i && !u && r?.();
|
|
1170
|
-
}, [i, r, _.length, u,
|
|
1170
|
+
}, [i, r, _.length, u, J]);
|
|
1171
1171
|
const q = pt ? _.find((o) => o.id === pt) : null, j = mt ? N.getHeaderGroups()[0]?.headers.find((o) => o.id === mt) : null;
|
|
1172
1172
|
return /* @__PURE__ */ a(
|
|
1173
1173
|
Ze,
|
|
@@ -1233,12 +1233,12 @@ function Lo({
|
|
|
1233
1233
|
onDragCancel: ye,
|
|
1234
1234
|
modifiers: [We],
|
|
1235
1235
|
children: [
|
|
1236
|
-
/* @__PURE__ */ a(It, { style: { height: `${
|
|
1236
|
+
/* @__PURE__ */ a(It, { style: { height: `${X.getTotalSize()}px` }, children: /* @__PURE__ */ a(
|
|
1237
1237
|
St,
|
|
1238
1238
|
{
|
|
1239
1239
|
items: _.map((o) => o.id),
|
|
1240
1240
|
strategy: Ye,
|
|
1241
|
-
children:
|
|
1241
|
+
children: J.map((o) => {
|
|
1242
1242
|
if (o.index > _.length - 1)
|
|
1243
1243
|
return /* @__PURE__ */ a(
|
|
1244
1244
|
on,
|
package/dist/NewEntity.es.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { jsx as t, jsxs as f, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as z, forwardRef as Ue, useRef as ce, useEffect as Le, useLayoutEffect as Ve, useContext as Pe, useId as Je, useMemo as ge } from "react";
|
|
3
3
|
import { isEmpty as Ce } from "lodash";
|
|
4
4
|
import "primereact/confirmdialog";
|
|
5
5
|
import { toast as me } from "react-toastify";
|
|
6
6
|
import { g as Xe, R as Me } from "./chunks/realtimeUpdatesUtils.es.js";
|
|
7
7
|
import { p as be, c as Ze, a as Ge } from "./chunks/iconUtils.es.js";
|
|
8
|
-
import {
|
|
8
|
+
import { bs as Qe } from "./chunks/searchTerms.es.js";
|
|
9
9
|
import "axios";
|
|
10
|
-
import {
|
|
10
|
+
import { dx as Ye } from "./chunks/getUris.es.js";
|
|
11
11
|
import "@module-federation/enhanced/runtime";
|
|
12
12
|
import "@ynput/ayon-addon/host";
|
|
13
|
-
import { Dropdown as De, Icon as Q, InputText as he, Button as fe, InputSwitch as Te, InputNumber as je, Spacer as
|
|
14
|
-
import {
|
|
13
|
+
import { Dropdown as De, Icon as Q, InputText as he, Button as fe, InputSwitch as Te, InputNumber as je, Spacer as $e, theme as qe, Dialog as et, ShortcutTag as tt, Toolbar as nt, SaveButton as at } from "@ynput/ayon-react-components";
|
|
14
|
+
import { q as Ne, s as ze, M as rt } from "./chunks/TableExportContextInstance.es.js";
|
|
15
15
|
import "semver";
|
|
16
16
|
import "./chunks/ContextMenuContextInstance.es.js";
|
|
17
17
|
import Ae from "clsx";
|
|
18
18
|
import "uuid";
|
|
19
19
|
import "react-dom";
|
|
20
|
-
import "react-redux";
|
|
21
20
|
import "react-router-dom";
|
|
22
|
-
import { g as ot,
|
|
21
|
+
import { g as ot, d as st, C as lt, h as it, i as ct, p as dt } from "./chunks/MetaWidget.es.js";
|
|
23
22
|
import { N as pt, u as ft } from "./chunks/NewEntityContextInstance.es.js";
|
|
24
23
|
import E from "styled-components";
|
|
25
24
|
import { a as ut, K as mt } from "./chunks/platform.es.js";
|
|
26
|
-
import "./chunks/
|
|
25
|
+
import "./chunks/FilmstripEntityCard.es.js";
|
|
27
26
|
import "date-fns";
|
|
28
27
|
import "@ynput/ayon-addon";
|
|
29
28
|
import "lexical";
|
|
@@ -39,6 +38,7 @@ import "@lexical/react/LexicalDecoratorBlockNode";
|
|
|
39
38
|
import { u as ht } from "./chunks/useHierarchySelection.es.js";
|
|
40
39
|
import { n as te } from "./chunks/entityDefinitions.es.js";
|
|
41
40
|
import "@tanstack/react-table";
|
|
41
|
+
import "react-redux";
|
|
42
42
|
const Ee = (i, m, u) => {
|
|
43
43
|
const c = i.match(/\d+$/), w = m.match(/\d+$/), h = c ? parseInt(c[0], 10) : NaN, D = (w ? parseInt(w[0], 10) : NaN) - h;
|
|
44
44
|
if (isNaN(D)) return [];
|
|
@@ -57,7 +57,7 @@ const Ee = (i, m, u) => {
|
|
|
57
57
|
);
|
|
58
58
|
return c ? c.name : "";
|
|
59
59
|
}, kn = ({ children: i }) => {
|
|
60
|
-
const { projectName: m, ...u } = Ne(), { attribFields: c } = ot(), { findNonInheritedValues: w, getFolderById: h } =
|
|
60
|
+
const { projectName: m, ...u } = Ne(), { attribFields: c } = ot(), { findNonInheritedValues: w, getFolderById: h } = ze(), { attrib: n = {}, statuses: D } = u || {}, { anatomy: r } = Ne(), { entity_naming: q = { capitalization: "lower", separator: "_" } } = r, { rowSelection: v, sliceType: O } = st(), j = D?.filter((a) => a.scope?.includes("task"))?.[0]?.name || D?.[0]?.name || "none", W = D?.filter((a) => a.scope?.includes("folder"))?.[0]?.name || D?.[0]?.name || "none", [F, R] = z(null), [p, K] = z(null), L = { label: "", subType: "", name: "" }, [b, ne] = z(L), [H, J] = z({
|
|
61
61
|
active: !1,
|
|
62
62
|
increment: "",
|
|
63
63
|
length: 10,
|
|
@@ -494,7 +494,7 @@ const Ct = ({
|
|
|
494
494
|
const { base: F, increment: R, length: p, type: K, id: L, prefix: b, prefixDepth: ne, parentBases: H } = W, J = W.entityType, X = !n && D || q;
|
|
495
495
|
let ae = [];
|
|
496
496
|
F && R && p && (ae = Ee(F, R, p));
|
|
497
|
-
const [de, U] =
|
|
497
|
+
const [de, U] = z(ae), Y = ce(null), ee = ce(null), B = (s) => {
|
|
498
498
|
s?.preventDefault && s?.preventDefault();
|
|
499
499
|
let { value: S, id: _ } = s.target;
|
|
500
500
|
_ === "prefixDepth" && (S = parseInt(String(S), 10));
|
|
@@ -534,7 +534,7 @@ const Ct = ({
|
|
|
534
534
|
} : () => {
|
|
535
535
|
ee.current?.focus();
|
|
536
536
|
}, 50);
|
|
537
|
-
}, [a, d] =
|
|
537
|
+
}, [a, d] = z(!0);
|
|
538
538
|
Le(
|
|
539
539
|
() => {
|
|
540
540
|
const s = setTimeout(() => {
|
|
@@ -545,7 +545,7 @@ const Ct = ({
|
|
|
545
545
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
546
546
|
[]
|
|
547
547
|
);
|
|
548
|
-
const y = St(de, 5, b ? r : void 0), k = ce(null), [o, g] =
|
|
548
|
+
const y = St(de, 5, b ? r : void 0), k = ce(null), [o, g] = z(0);
|
|
549
549
|
return Ve(() => {
|
|
550
550
|
k.current && g(k.current.offsetWidth);
|
|
551
551
|
}, [k.current, b]), J === "task" ? /* @__PURE__ */ t(
|
|
@@ -722,7 +722,7 @@ const Ct = ({
|
|
|
722
722
|
}
|
|
723
723
|
)
|
|
724
724
|
] }),
|
|
725
|
-
/* @__PURE__ */ t(
|
|
725
|
+
/* @__PURE__ */ t($e, {}),
|
|
726
726
|
n && /* @__PURE__ */ t(
|
|
727
727
|
fe,
|
|
728
728
|
{
|
|
@@ -840,7 +840,7 @@ const Ct = ({
|
|
|
840
840
|
labelRef: w,
|
|
841
841
|
nameInfo: h = ""
|
|
842
842
|
}) => {
|
|
843
|
-
const n = Je(), [D, r] =
|
|
843
|
+
const n = Je(), [D, r] = z(!1), [q, v] = z(void 0), O = ce(null), j = () => {
|
|
844
844
|
r(!0), u(!0), v(m.name), setTimeout(() => {
|
|
845
845
|
O.current && (O.current.focus(), O.current.select());
|
|
846
846
|
}, 0);
|
|
@@ -971,17 +971,17 @@ const Ct = ({
|
|
|
971
971
|
onOpenNew: W,
|
|
972
972
|
config: F,
|
|
973
973
|
parentFolderIds: R
|
|
974
|
-
} = ft(), [p, K] =
|
|
974
|
+
} = ft(), [p, K] = z(!1), { selectedCells: L } = it() || {}, b = ht(), { getFolderById: ne } = ze(), H = ct(), J = H?.getEntityById, X = H?.showHierarchy ?? !0, ae = ge(() => {
|
|
975
975
|
if (R !== null) return R;
|
|
976
976
|
const e = L ? Array.from(L).map((T) => dt(T)) : [], x = Array.from(
|
|
977
977
|
new Set(
|
|
978
978
|
e.filter((T) => T && T.colId !== Me).map((T) => T?.rowId).filter(Boolean)
|
|
979
979
|
)
|
|
980
|
-
),
|
|
980
|
+
), $ = Array.from(
|
|
981
981
|
new Set(
|
|
982
982
|
e.filter((T) => T?.colId === Me).map((T) => T?.rowId).filter(Boolean)
|
|
983
983
|
)
|
|
984
|
-
), le = x.length > 0 ? x :
|
|
984
|
+
), le = x.length > 0 ? x : $;
|
|
985
985
|
if (le.length > 0) {
|
|
986
986
|
const T = le.map((G) => J?.(G)), ie = T.filter(
|
|
987
987
|
(G) => G?.entityType === "folder"
|
|
@@ -1002,27 +1002,27 @@ const Ct = ({
|
|
|
1002
1002
|
return { value: e, label: x?.label || x?.name || e };
|
|
1003
1003
|
}),
|
|
1004
1004
|
[U, J, ne]
|
|
1005
|
-
), [B, a] =
|
|
1005
|
+
), [B, a] = z(null);
|
|
1006
1006
|
let d = B !== null ? B : U;
|
|
1007
1007
|
d = d.filter((e) => U.includes(e)), d.length === 0 && U.length > 0 && (d = U);
|
|
1008
|
-
const y = d.map((e) => ee.find((x) => x.value === e)?.label || "").filter(Boolean), k = y[0] || "", o = Ce(U), [g, s] =
|
|
1008
|
+
const y = d.map((e) => ee.find((x) => x.value === e)?.label || "").filter(Boolean), k = y[0] || "", o = Ce(U), [g, s] = z(!1), [S, _] = z(!1), C = { label: "", subType: "", name: "" }, I = () => {
|
|
1009
1009
|
let e = "Add New ";
|
|
1010
1010
|
return o && n === "folder" && (e += "Root "), e += n ? te[n].label : "", o || (y.length > 2 ? e += " - " + y.slice(0, 2).join(", ") + ` +${y.length - 2} more` : e += " - " + y.join(", ")), e;
|
|
1011
1011
|
}, P = (n === "folder" ? h?.folderTypes : h?.taskTypes) || [], l = (e, x) => {
|
|
1012
1012
|
if (!x) return;
|
|
1013
|
-
let
|
|
1014
|
-
if (
|
|
1013
|
+
let $ = { ...r };
|
|
1014
|
+
if ($[x] = e, e && x === "subType") {
|
|
1015
1015
|
const le = P.find((ie) => ie.name === r.subType), T = P.find((ie) => ie.name === e);
|
|
1016
1016
|
if (T && r.label === le?.name) {
|
|
1017
|
-
|
|
1017
|
+
$.label = T.name;
|
|
1018
1018
|
const ke = be(r.label, F);
|
|
1019
|
-
r.name === ke && (
|
|
1019
|
+
r.name === ke && ($.name = be($.label, F));
|
|
1020
1020
|
}
|
|
1021
1021
|
setTimeout(() => {
|
|
1022
1022
|
M.current?.focus();
|
|
1023
1023
|
}, 100);
|
|
1024
|
-
} else x === "label" ? (
|
|
1025
|
-
q(
|
|
1024
|
+
} else x === "label" ? ($.label = e, S || ($.name = be(e, F))) : x === "name" && (_(!0), $.name = e);
|
|
1025
|
+
q($);
|
|
1026
1026
|
}, Z = (e) => {
|
|
1027
1027
|
q({ ...r, label: e.base, subType: e.type }), O({
|
|
1028
1028
|
...v,
|
|
@@ -1033,14 +1033,14 @@ const Ct = ({
|
|
|
1033
1033
|
});
|
|
1034
1034
|
}, A = ce(null), M = ce(null), N = () => {
|
|
1035
1035
|
D(null), q(C), O((e) => ({ ...e, active: !1 })), _(!1), a(null);
|
|
1036
|
-
}, V = () => setTimeout(() => A.current?.open(), 180), [oe, ye] =
|
|
1036
|
+
}, V = () => setTimeout(() => A.current?.open(), 180), [oe, ye] = z(!1), se = async (e) => {
|
|
1037
1037
|
const x = Ze(r.label);
|
|
1038
1038
|
if (!x.valid) {
|
|
1039
1039
|
me.error(x.error || "Invalid label");
|
|
1040
1040
|
return;
|
|
1041
1041
|
}
|
|
1042
|
-
const { valid:
|
|
1043
|
-
if (
|
|
1042
|
+
const { valid: $, error: le } = Ge(r.name);
|
|
1043
|
+
if (!$) {
|
|
1044
1044
|
me.error(le || "Invalid name");
|
|
1045
1045
|
return;
|
|
1046
1046
|
}
|
|
@@ -1087,7 +1087,7 @@ const Ct = ({
|
|
|
1087
1087
|
);
|
|
1088
1088
|
Tt({ options: ve, onOpenNew: W, enabled: w });
|
|
1089
1089
|
const We = (e) => {
|
|
1090
|
-
const x = ve.find((
|
|
1090
|
+
const x = ve.find(($) => $.value === e);
|
|
1091
1091
|
x && !x.disabled && W(x.type, { isSequence: x.isSequence });
|
|
1092
1092
|
}, Ie = n === "task" && Ce(d), He = !r.label || !r.subType || Ie;
|
|
1093
1093
|
return /* @__PURE__ */ f(ue, { children: [
|
|
@@ -1144,7 +1144,7 @@ const Ct = ({
|
|
|
1144
1144
|
}
|
|
1145
1145
|
)
|
|
1146
1146
|
] }),
|
|
1147
|
-
/* @__PURE__ */ t(
|
|
1147
|
+
/* @__PURE__ */ t($e, {}),
|
|
1148
1148
|
/* @__PURE__ */ t("span", { children: "Create more" }),
|
|
1149
1149
|
/* @__PURE__ */ t(
|
|
1150
1150
|
Te,
|