@ynput/ayon-frontend-shared 0.4.7 → 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.
Files changed (48) hide show
  1. package/dist/DetailsPanel.es.js +684 -651
  2. package/dist/ListTable.es.js +8 -7
  3. package/dist/ProjectTreeTable.es.js +2223 -2184
  4. package/dist/Slicer.es.js +152 -120
  5. package/dist/api.es.js +202 -201
  6. package/dist/chunks/Actions.es.js +20 -20
  7. package/dist/chunks/ColumnDropIndicator.es.js +127 -241
  8. package/dist/chunks/DeleteEntitiesContext.es.js +36 -36
  9. package/dist/chunks/DetailsDialog.es.js +3 -3
  10. package/dist/chunks/EntityPath.es.js +22 -22
  11. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  12. package/dist/chunks/EntityTooltip.es.js +12 -12
  13. package/dist/chunks/Feed.es.js +2 -2
  14. package/dist/chunks/FilterErrorActions.es.js +5 -5
  15. package/dist/chunks/GlobalContext.es.js +14 -14
  16. package/dist/chunks/InfoMessage.es.js +146 -0
  17. package/dist/chunks/Menu.es.js +5 -5
  18. package/dist/chunks/MenuContext.es.js +75 -73
  19. package/dist/chunks/MetaWidget.es.js +1968 -1960
  20. package/dist/chunks/NewEntityContext.es.js +538 -543
  21. package/dist/chunks/PlayableIcon.es.js +54 -54
  22. package/dist/chunks/ProjectContext.es.js +12 -12
  23. package/dist/chunks/ProjectFoldersContext.es.js +84 -76
  24. package/dist/chunks/RepresentationsList.es.js +1 -1
  25. package/dist/chunks/ReviewablesSelector.es.js +387 -384
  26. package/dist/chunks/SimpleTable.es.js +286 -283
  27. package/dist/chunks/Slicer.es.js +1121 -683
  28. package/dist/chunks/VersionUploadContext.es.js +26 -26
  29. package/dist/chunks/ViewsContext.es.js +31 -31
  30. package/dist/chunks/Watchers.es.js +1 -1
  31. package/dist/chunks/entityDefinitions.es.js +275 -133
  32. package/dist/chunks/getUris.es.js +236 -231
  33. package/dist/chunks/searchTerms.es.js +9 -0
  34. package/dist/chunks/useAttributeEnums.es.js +69 -61
  35. package/dist/chunks/useLocalStorage.es.js +10 -10
  36. package/dist/chunks/viewUpdateHelper.es.js +23 -23
  37. package/dist/components.es.js +166 -166
  38. package/dist/hooks.es.js +44 -43
  39. package/dist/index.es.js +11 -10
  40. package/dist/types/DetailsPanel.d.ts +6 -0
  41. package/dist/types/ProjectTreeTable.d.ts +28 -6
  42. package/dist/types/RepresentationsList.d.ts +3 -0
  43. package/dist/types/SimpleTable.d.ts +1 -0
  44. package/dist/types/Slicer.d.ts +103 -18
  45. package/dist/types/api.d.ts +13 -0
  46. package/dist/types/components.d.ts +7 -5
  47. package/package.json +11 -10
  48. package/dist/chunks/useSlicerSplitter.es.js +0 -18
@@ -1,54 +1,54 @@
1
- import { jsx as t, jsxs as p, Fragment as fe } from "react/jsx-runtime";
2
- import { forwardRef as Ge, useState as $, useRef as ie, useEffect as Be, useLayoutEffect as Qe, useContext as Ne, useMemo as ge, createContext as Ye } from "react";
3
- import { isEmpty as Ee } from "lodash";
1
+ import { jsx as t, jsxs as p, Fragment as ue } from "react/jsx-runtime";
2
+ import { forwardRef as Ve, useState as z, useRef as ce, useEffect as Le, useLayoutEffect as Je, useContext as Ce, useMemo as ge, createContext as Xe } from "react";
3
+ import { isEmpty as Te } from "lodash";
4
4
  import "primereact/confirmdialog";
5
- import { toast as pe } from "react-toastify";
6
- import { R as Me, g as et } from "./realtimeUpdatesUtils.es.js";
7
- import { p as be, c as tt, a as nt } from "./parseHtmlToPlainTextWithLinks.es.js";
8
- import { be as at } from "./searchTerms.es.js";
9
- import { Dropdown as Pe, Icon as te, InputText as ue, Button as de, InputSwitch as Oe, InputNumber as Ae, Spacer as $e, theme as je, Dialog as rt, ShortcutTag as ot, Toolbar as st, SaveButton as lt } from "@ynput/ayon-react-components";
5
+ import { toast as me } from "react-toastify";
6
+ import { R as je, g as Ze } from "./realtimeUpdatesUtils.es.js";
7
+ import { p as be, c as Ge, a as Qe } from "./parseHtmlToPlainTextWithLinks.es.js";
8
+ import { be as Ye } from "./searchTerms.es.js";
9
+ import { Dropdown as qe, Icon as Q, InputText as he, Button as pe, InputSwitch as Ne, InputNumber as Me, Spacer as ze, theme as Fe, Dialog as et, ShortcutTag as tt, Toolbar as nt, SaveButton as at } from "@ynput/ayon-react-components";
10
10
  import E from "styled-components";
11
- import { a as it, K as ct } from "./platform.es.js";
11
+ import { a as rt, K as ot } from "./platform.es.js";
12
12
  import "uuid";
13
- import { f as dt, g as ft, h as pt, p as ut, i as mt } from "./MetaWidget.es.js";
14
- import Ke from "clsx";
15
- import { n as ne, b as _e } from "./entityDefinitions.es.js";
16
- import { dj as ht } from "./getUris.es.js";
17
- import { a as De } from "./ProjectContext.es.js";
18
- import { u as We } from "./ProjectFoldersContext.es.js";
19
- import { a as yt } from "./MenuContext.es.js";
20
- const qe = (o, m, u) => {
21
- const i = o.match(/\d+$/), x = m.match(/\d+$/), h = i ? parseInt(i[0], 10) : NaN, O = (x ? parseInt(x[0], 10) : NaN) - h;
13
+ import { f as st, g as lt, h as it, p as ct, i as dt } from "./MetaWidget.es.js";
14
+ import Ae from "clsx";
15
+ import { n as te, b as ft, u as pt } from "./entityDefinitions.es.js";
16
+ import { dk as ut } from "./getUris.es.js";
17
+ import { a as Ee } from "./ProjectContext.es.js";
18
+ import { u as Be } from "./ProjectFoldersContext.es.js";
19
+ import { a as mt } from "./MenuContext.es.js";
20
+ const Oe = (r, m, u) => {
21
+ const d = r.match(/\d+$/), v = m.match(/\d+$/), h = d ? parseInt(d[0], 10) : NaN, O = (v ? parseInt(v[0], 10) : NaN) - h;
22
22
  if (isNaN(O)) return [];
23
- const s = [];
23
+ const o = [];
24
24
  for (let D = 0; D < u; D++) {
25
- const g = h + D * O, F = o.match(/\d+$/);
25
+ const y = h + D * O, F = r.match(/\d+$/);
26
26
  if (!F) return [];
27
- const M = String(g).padStart(F[0].length, "0"), V = o.replace(/\d+$/, M);
28
- s.push(V);
27
+ const A = String(y).padStart(F[0].length, "0"), _ = r.replace(/\d+$/, A);
28
+ o.push(_);
29
29
  }
30
- return s;
31
- }, we = Ge(
30
+ return o;
31
+ }, xe = Ve(
32
32
  ({
33
- value: o,
33
+ value: r,
34
34
  options: m,
35
35
  onChange: u,
36
- style: i,
37
- mainStyle: x,
36
+ style: d,
37
+ mainStyle: v,
38
38
  disabled: h,
39
39
  placeholder: n,
40
40
  isChanged: O,
41
- align: s,
41
+ align: o,
42
42
  type: D,
43
- ...g
43
+ ...y
44
44
  }, F) => /* @__PURE__ */ t(
45
- Pe,
45
+ qe,
46
46
  {
47
47
  options: m,
48
48
  dataKey: "name",
49
- value: o,
50
- valueStyle: i,
51
- onChange: (M) => u(M[0]),
49
+ value: r,
50
+ valueStyle: d,
51
+ onChange: (A) => u(A[0]),
52
52
  disabled: h,
53
53
  isChanged: O,
54
54
  placeholder: n,
@@ -56,15 +56,15 @@ const qe = (o, m, u) => {
56
56
  search: !0,
57
57
  searchFields: ["name"],
58
58
  emptyMessage: "None Set",
59
- style: x,
60
- align: s,
59
+ style: v,
60
+ align: o,
61
61
  ref: F,
62
- ...g
62
+ ...y
63
63
  }
64
64
  )
65
65
  );
66
- we.displayName = "TypeEditor";
67
- const gt = E.div`
66
+ xe.displayName = "TypeEditor";
67
+ const ht = E.div`
68
68
  position: relative;
69
69
  display: flex;
70
70
  flex-direction: column;
@@ -81,7 +81,7 @@ const gt = E.div`
81
81
  &.task {
82
82
  width: 100%;
83
83
  }
84
- `, Ue = E.div`
84
+ `, $e = E.div`
85
85
  display: flex;
86
86
  flex-direction: column;
87
87
  /* panel */
@@ -112,7 +112,7 @@ const gt = E.div`
112
112
  .form > .icon {
113
113
  padding: 5px 0;
114
114
  }
115
- `, bt = E(Ue)`
115
+ `, yt = E($e)`
116
116
  & > div {
117
117
  align-items: center;
118
118
  }
@@ -120,7 +120,7 @@ const gt = E.div`
120
120
  border-radius: var(--border-radius-l);
121
121
  padding-bottom: 4px;
122
122
  padding: 2px 4px;
123
- `, Te = E.div`
123
+ `, Se = E.div`
124
124
  display: flex;
125
125
  flex-direction: row;
126
126
  align-items: flex-end;
@@ -133,7 +133,7 @@ const gt = E.div`
133
133
  strong {
134
134
  font-weight: 700;
135
135
  }
136
- `, oe = E.div`
136
+ `, re = E.div`
137
137
  display: flex;
138
138
  flex-direction: column;
139
139
  width: min-content;
@@ -152,7 +152,7 @@ const gt = E.div`
152
152
  text-overflow: ellipsis;
153
153
  white-space: nowrap;
154
154
  }
155
- `, wt = E.div`
155
+ `, gt = E.div`
156
156
  display: flex;
157
157
  flex-direction: column;
158
158
  gap: var(--base-gap-small);
@@ -163,18 +163,18 @@ const gt = E.div`
163
163
  display: none;
164
164
  }
165
165
  width: 100%;
166
- `, xt = E.div`
166
+ `, bt = E.div`
167
167
  display: flex;
168
168
  flex-direction: row;
169
169
  align-items: center;
170
170
  gap: var(--base-gap-small);
171
171
  width: 100%;
172
- `, vt = E.div`
172
+ `, xt = E.div`
173
173
  display: flex;
174
174
  flex-direction: column;
175
175
  gap: var(--base-gap-small);
176
176
  z-index: 10;
177
- `, St = E.span``, It = E.span`
177
+ `, wt = E.span``, vt = E.span`
178
178
  background-color: var(--md-sys-color-surface-container-low);
179
179
  padding: 5px 8px;
180
180
  border-radius: var(--border-radius);
@@ -185,16 +185,16 @@ const gt = E.div`
185
185
  color: var(--md-sys-color-outline);
186
186
  min-height: 30px;
187
187
  `;
188
- function kt(o, m, u = "") {
189
- if (o.length <= m)
190
- return o.map((i) => u + i).join(", ");
188
+ function kt(r, m, u = "") {
189
+ if (r.length <= m)
190
+ return r.map((d) => u + d).join(", ");
191
191
  {
192
- const i = o.slice(0, Math.ceil(m / 2)).map((h) => u + h), x = o.slice(-1).map((h) => u + h);
193
- return `${i.join(", ")} ... ${x.join(", ")}`;
192
+ const d = r.slice(0, Math.ceil(m / 2)).map((h) => u + h), v = r.slice(-1).map((h) => u + h);
193
+ return `${d.join(", ")} ... ${v.join(", ")}`;
194
194
  }
195
195
  }
196
- function Le(o) {
197
- return o === "Shot" ? {
196
+ function Re(r) {
197
+ return r === "Shot" ? {
198
198
  base: "0010",
199
199
  increment: "0020",
200
200
  length: 10,
@@ -206,306 +206,306 @@ function Le(o) {
206
206
  difference: 1
207
207
  };
208
208
  }
209
- const Ct = ({
210
- onChange: o,
209
+ const It = ({
210
+ onChange: r,
211
211
  parentId: m = null,
212
212
  children: u,
213
- depth: i,
214
- onNew: x,
213
+ depth: d,
214
+ onNew: v,
215
215
  index: h,
216
216
  nesting: n = !0,
217
217
  isRoot: O,
218
- parentLabel: s,
218
+ parentLabel: o,
219
219
  prefixDisabled: D,
220
- typeSelectRef: g,
220
+ typeSelectRef: y,
221
221
  onLastInputKeydown: F,
222
- folders: M,
223
- ...V
222
+ folders: A,
223
+ ..._
224
224
  }) => {
225
- const { base: q, increment: l, length: A, type: Z, id: K, prefix: T, prefixDepth: G, parentBases: L } = V, Q = V.entityType, J = !n && O || D;
226
- let Y = [];
227
- q && l && A && (Y = qe(q, l, A));
228
- const [ce, se] = $(Y), ae = ie(null), _ = ie(null), W = (c) => {
229
- c?.preventDefault && c?.preventDefault();
230
- let { value: I, id: j } = c.target;
231
- j === "prefixDepth" && (I = parseInt(String(I), 10));
232
- const k = { [j]: I }, w = { ...V, ...k };
233
- if (j === "type") {
234
- let R = !1;
235
- const d = M.find((U) => U.name === I);
236
- for (const U of M) {
237
- if (w.base === "") {
238
- R = !0;
225
+ const { base: q, increment: s, length: R, type: J, id: K, prefix: x, prefixDepth: ne, parentBases: W } = _, V = _.entityType, X = !n && O || D;
226
+ let ae = [];
227
+ q && s && R && (ae = Oe(q, s, R));
228
+ const [de, H] = z(ae), Y = ce(null), ee = ce(null), B = (i) => {
229
+ i?.preventDefault && i?.preventDefault();
230
+ let { value: C, id: $ } = i.target;
231
+ $ === "prefixDepth" && (C = parseInt(String(C), 10));
232
+ const T = { [$]: C }, k = { ..._, ...T };
233
+ if ($ === "type") {
234
+ let P = !1;
235
+ const c = A.find((j) => j.name === C);
236
+ for (const j of A) {
237
+ if (k.base === "") {
238
+ P = !0;
239
239
  break;
240
240
  }
241
- for (const C in U)
242
- if (typeof U[C] == "string" && w.base?.toLowerCase().includes(U[C].toLowerCase())) {
243
- R = !0;
241
+ for (const N in j)
242
+ if (typeof j[N] == "string" && k.base?.toLowerCase().includes(j[N].toLowerCase())) {
243
+ P = !0;
244
244
  break;
245
245
  }
246
246
  }
247
- if (!R || !d) return;
248
- const H = Q === "folder" && d.shortName || d.name, z = Le(String(I));
249
- w.base = H + z.base, w.increment = H + z.increment, w.length = z.length;
247
+ if (!P || !c) return;
248
+ const Z = V === "folder" && c.shortName || c.name, M = Re(String(C));
249
+ k.base = Z + M.base, k.increment = Z + M.increment, k.length = M.length;
250
250
  }
251
- if (j === "base") {
252
- const R = Le(w.type), d = String(I), H = d.replace(/[^a-zA-Z]/g, ""), z = d.replace(/[^0-9]/g, ""), U = parseInt(z, 10), C = z.length, P = H + (U + R.difference).toString().padStart(C, "0");
253
- w.increment = P.replace("NaN", "");
251
+ if ($ === "base") {
252
+ const P = Re(k.type), c = String(C), Z = c.replace(/[^a-zA-Z]/g, ""), M = c.replace(/[^0-9]/g, ""), j = parseInt(M, 10), N = M.length, U = Z + (j + P.difference).toString().padStart(N, "0");
253
+ k.increment = U.replace("NaN", "");
254
254
  }
255
- if (o(
256
- w,
255
+ if (r(
256
+ k,
257
257
  typeof K == "string" ? K : void 0,
258
- Q
259
- ), w.base && w.increment && w.length) {
260
- const R = qe(w.base, w.increment, w.length);
261
- se(R);
258
+ V
259
+ ), k.base && k.increment && k.length) {
260
+ const P = Oe(k.base, k.increment, k.length);
261
+ H(P);
262
262
  }
263
- j === "type" && setTimeout(J ? () => {
264
- ae.current?.focus(), ae.current?.select();
263
+ $ === "type" && setTimeout(X ? () => {
264
+ Y.current?.focus(), Y.current?.select();
265
265
  } : () => {
266
- _.current?.focus();
266
+ ee.current?.focus();
267
267
  }, 50);
268
- }, [a, v] = $(!0);
269
- Be(
268
+ }, [a, f] = z(!0);
269
+ Le(
270
270
  () => {
271
- const c = setTimeout(() => {
272
- v(!1);
271
+ const i = setTimeout(() => {
272
+ f(!1);
273
273
  }, 1e3);
274
- return () => clearTimeout(c);
274
+ return () => clearTimeout(i);
275
275
  },
276
276
  // eslint-disable-next-line react-hooks/exhaustive-deps
277
277
  []
278
278
  );
279
- const S = kt(ce, 5, T ? s : void 0), f = ie(null), [r, b] = $(0);
280
- return Qe(() => {
281
- f.current && b(f.current.offsetWidth);
282
- }, [f.current, T]), Q === "task" ? /* @__PURE__ */ t(
283
- bt,
279
+ const g = kt(de, 5, x ? o : void 0), S = ce(null), [l, b] = z(0);
280
+ return Je(() => {
281
+ S.current && b(S.current.offsetWidth);
282
+ }, [S.current, x]), V === "task" ? /* @__PURE__ */ t(
283
+ yt,
284
284
  {
285
- className: Ke("task", { "is-new": a, nesting: n, "no-nesting": !n }),
286
- style: { zIndex: 100 - (i ?? 0) - (h ?? 0) },
287
- children: /* @__PURE__ */ p(Te, { className: "form", children: [
288
- /* @__PURE__ */ t(te, { icon: "task_alt" }),
285
+ className: Ae("task", { "is-new": a, nesting: n, "no-nesting": !n }),
286
+ style: { zIndex: 100 - (d ?? 0) - (h ?? 0) },
287
+ children: /* @__PURE__ */ p(Se, { className: "form", children: [
288
+ /* @__PURE__ */ t(Q, { icon: "task_alt" }),
289
289
  /* @__PURE__ */ t("strong", { children: "Task" }),
290
290
  /* @__PURE__ */ t("label", { children: "Type" }),
291
291
  /* @__PURE__ */ t(
292
- we,
292
+ xe,
293
293
  {
294
- value: [Z],
295
- onChange: (c) => W({ target: { value: c, id: "type" } }),
296
- options: M,
294
+ value: [J],
295
+ onChange: (i) => B({ target: { value: i, id: "type" } }),
296
+ options: A,
297
297
  style: { width: 160 },
298
298
  align: "right"
299
299
  }
300
300
  ),
301
301
  /* @__PURE__ */ t("label", { children: "label" }),
302
302
  /* @__PURE__ */ t(
303
- ue,
303
+ he,
304
304
  {
305
305
  value: q,
306
306
  id: "base",
307
- onChange: W,
307
+ onChange: B,
308
308
  placeholder: "compositing...",
309
309
  autoComplete: "off"
310
310
  }
311
311
  ),
312
312
  /* @__PURE__ */ t(
313
- de,
313
+ pe,
314
314
  {
315
315
  icon: "close",
316
316
  variant: "text",
317
- onClick: () => o({ id: K, delete: !0 }, m),
317
+ onClick: () => r({ id: K, delete: !0 }, m),
318
318
  className: "delete"
319
319
  }
320
320
  )
321
321
  ] })
322
322
  }
323
- ) : /* @__PURE__ */ p(gt, { className: "folder", children: [
324
- /* @__PURE__ */ p(xt, { className: "seq", style: { zIndex: 100 - (i ?? 0) - (h ?? 0) }, children: [
325
- n && /* @__PURE__ */ p(vt, { className: "buttons", children: [
326
- /* @__PURE__ */ p(Te, { children: [
327
- i === 0 && /* @__PURE__ */ t(
328
- de,
323
+ ) : /* @__PURE__ */ p(ht, { className: "folder", children: [
324
+ /* @__PURE__ */ p(bt, { className: "seq", style: { zIndex: 100 - (d ?? 0) - (h ?? 0) }, children: [
325
+ n && /* @__PURE__ */ p(xt, { className: "buttons", children: [
326
+ /* @__PURE__ */ p(Se, { children: [
327
+ d === 0 && /* @__PURE__ */ t(
328
+ pe,
329
329
  {
330
330
  icon: "south",
331
- onClick: () => x?.(null),
331
+ onClick: () => v?.(null),
332
332
  label: "Root",
333
333
  title: "add root folder"
334
334
  }
335
335
  ),
336
336
  /* @__PURE__ */ t(
337
- de,
337
+ pe,
338
338
  {
339
- icon: ne.folder.icon,
340
- onClick: () => K && x?.(K, "folder"),
341
- label: i === 0 ? ne.folder.label : void 0,
339
+ icon: te.folder.icon,
340
+ onClick: () => K && v?.(K, "folder"),
341
+ label: d === 0 ? te.folder.label : void 0,
342
342
  title: "add nested folder"
343
343
  }
344
344
  )
345
345
  ] }),
346
346
  /* @__PURE__ */ t(
347
- de,
347
+ pe,
348
348
  {
349
- icon: ne.task.icon,
350
- onClick: () => K && x?.(K, "task"),
351
- label: i === 0 ? ne.task.label : void 0,
349
+ icon: te.task.icon,
350
+ onClick: () => K && v?.(K, "task"),
351
+ label: d === 0 ? te.task.label : void 0,
352
352
  title: "add nested task",
353
353
  style: { width: "max-content", marginLeft: "auto" }
354
354
  }
355
355
  )
356
356
  ] }),
357
357
  /* @__PURE__ */ p(
358
- Ue,
358
+ $e,
359
359
  {
360
- className: Ke({ "is-new": a, "no-nesting": !n }),
361
- ref: f,
360
+ className: Ae({ "is-new": a, "no-nesting": !n }),
361
+ ref: S,
362
362
  children: [
363
- /* @__PURE__ */ p(Te, { className: "form folder", children: [
364
- /* @__PURE__ */ p(oe, { children: [
363
+ /* @__PURE__ */ p(Se, { className: "form folder", children: [
364
+ /* @__PURE__ */ p(re, { children: [
365
365
  /* @__PURE__ */ t("label", { children: "Type" }),
366
366
  /* @__PURE__ */ t(
367
- we,
367
+ xe,
368
368
  {
369
- value: [Z],
370
- onChange: (c) => W({ target: { value: c, id: "type" } }),
371
- options: M,
369
+ value: [J],
370
+ onChange: (i) => B({ target: { value: i, id: "type" } }),
371
+ options: A,
372
372
  style: { width: 160 },
373
373
  align: "right",
374
- ref: g
374
+ ref: y
375
375
  }
376
376
  )
377
377
  ] }),
378
- /* @__PURE__ */ t(te, { icon: "trending_flat" }),
379
- (i !== 0 || !n) && /* @__PURE__ */ p(fe, { children: [
380
- /* @__PURE__ */ p(fe, { children: [
381
- /* @__PURE__ */ p(oe, { children: [
378
+ /* @__PURE__ */ t(Q, { icon: "trending_flat" }),
379
+ (d !== 0 || !n) && /* @__PURE__ */ p(ue, { children: [
380
+ /* @__PURE__ */ p(ue, { children: [
381
+ /* @__PURE__ */ p(re, { children: [
382
382
  /* @__PURE__ */ t("label", { children: "Prefix" }),
383
383
  /* @__PURE__ */ t(
384
- Oe,
384
+ Ne,
385
385
  {
386
- checked: T,
386
+ checked: x,
387
387
  id: "prefix",
388
- onChange: () => W({ target: { value: !T, id: "prefix" } }),
389
- disabled: J,
390
- ref: _,
388
+ onChange: () => B({ target: { value: !x, id: "prefix" } }),
389
+ disabled: X,
390
+ ref: ee,
391
391
  switchStyle: { margin: "4px 0" }
392
392
  }
393
393
  )
394
394
  ] }),
395
- /* @__PURE__ */ t(te, { icon: "trending_flat" })
395
+ /* @__PURE__ */ t(Q, { icon: "trending_flat" })
396
396
  ] }),
397
- n && T && /* @__PURE__ */ p(oe, { children: [
397
+ n && x && /* @__PURE__ */ p(re, { children: [
398
398
  /* @__PURE__ */ t("label", { children: "Depth" }),
399
399
  /* @__PURE__ */ t(
400
- Ae,
400
+ Me,
401
401
  {
402
- value: G,
402
+ value: ne,
403
403
  id: "prefixDepth",
404
- onChange: W,
405
- max: L?.length,
404
+ onChange: B,
405
+ max: W?.length,
406
406
  min: 0
407
407
  }
408
408
  )
409
409
  ] })
410
410
  ] }),
411
- L && n && /* @__PURE__ */ t(oe, { style: { display: T ? "flex" : "none" }, children: /* @__PURE__ */ t(It, { children: L.join("") }) }),
412
- /* @__PURE__ */ p(oe, { className: "seq", children: [
411
+ W && n && /* @__PURE__ */ t(re, { style: { display: x ? "flex" : "none" }, children: /* @__PURE__ */ t(vt, { children: W.join("") }) }),
412
+ /* @__PURE__ */ p(re, { className: "seq", children: [
413
413
  /* @__PURE__ */ t("label", { children: "First Name" }),
414
414
  /* @__PURE__ */ t(
415
- ue,
415
+ he,
416
416
  {
417
417
  value: q,
418
418
  id: "base",
419
- ref: ae,
420
- onChange: W,
419
+ ref: Y,
420
+ onChange: B,
421
421
  placeholder: "ep101...",
422
422
  autoComplete: "off"
423
423
  }
424
424
  )
425
425
  ] }),
426
- /* @__PURE__ */ t(te, { icon: "trending_flat" }),
427
- /* @__PURE__ */ p(oe, { className: "seq", children: [
426
+ /* @__PURE__ */ t(Q, { icon: "trending_flat" }),
427
+ /* @__PURE__ */ p(re, { className: "seq", children: [
428
428
  /* @__PURE__ */ t("label", { children: "Second Name" }),
429
429
  /* @__PURE__ */ t(
430
- ue,
430
+ he,
431
431
  {
432
- value: l,
432
+ value: s,
433
433
  id: "increment",
434
- onChange: W,
434
+ onChange: B,
435
435
  placeholder: "ep102...",
436
436
  autoComplete: "off"
437
437
  }
438
438
  )
439
439
  ] }),
440
- /* @__PURE__ */ t(te, { icon: "trending_flat" }),
441
- /* @__PURE__ */ p(oe, { children: [
440
+ /* @__PURE__ */ t(Q, { icon: "trending_flat" }),
441
+ /* @__PURE__ */ p(re, { children: [
442
442
  /* @__PURE__ */ t("label", { children: "Count" }),
443
443
  /* @__PURE__ */ t(
444
- Ae,
444
+ Me,
445
445
  {
446
- value: A,
446
+ value: R,
447
447
  id: "length",
448
- onChange: W,
448
+ onChange: B,
449
449
  placeholder: "15...",
450
450
  min: 2,
451
- onFocus: (c) => c.target.select(),
451
+ onFocus: (i) => i.target.select(),
452
452
  onKeyDown: F
453
453
  }
454
454
  )
455
455
  ] }),
456
- /* @__PURE__ */ t($e, {}),
456
+ /* @__PURE__ */ t(ze, {}),
457
457
  n && /* @__PURE__ */ t(
458
- de,
458
+ pe,
459
459
  {
460
460
  icon: "close",
461
461
  variant: "text",
462
- onClick: () => o({ id: K, delete: !0 }),
463
- disabled: i === 0 && h === 0
462
+ onClick: () => r({ id: K, delete: !0 }),
463
+ disabled: d === 0 && h === 0
464
464
  }
465
465
  )
466
466
  ] }),
467
- !n && /* @__PURE__ */ p(St, { children: [
467
+ !n && /* @__PURE__ */ p(wt, { children: [
468
468
  "Example: ",
469
- S
469
+ g
470
470
  ] })
471
471
  ]
472
472
  }
473
473
  )
474
474
  ] }),
475
475
  n && /* @__PURE__ */ t(
476
- wt,
476
+ gt,
477
477
  {
478
478
  className: "children",
479
- style: { width: r, zIndex: 99 - (i ?? 0) - (h ?? 0) },
479
+ style: { width: l, zIndex: 99 - (d ?? 0) - (h ?? 0) },
480
480
  children: u
481
481
  }
482
482
  )
483
483
  ] });
484
- }, Tt = ({
485
- options: o,
484
+ }, St = ({
485
+ options: r,
486
486
  onOpenNew: m,
487
487
  enabled: u = !0
488
488
  }) => {
489
- const { menuOpen: i } = Ne(yt) || { menuOpen: !1 }, { editingCellId: x } = Ne(dt) || { editingCellId: null };
490
- Be(() => {
489
+ const { menuOpen: d } = Ce(mt) || { menuOpen: !1 }, { editingCellId: v } = Ce(st) || { editingCellId: null };
490
+ Le(() => {
491
491
  if (!u) return;
492
492
  const h = (n) => {
493
- if (i || n.target instanceof HTMLElement && (n.target.tagName === "INPUT" || n.target.tagName === "TEXTAREA" || n.target.isContentEditable || n.target.getAttribute("role") === "textbox") || x || n.ctrlKey || n.metaKey || n.altKey)
493
+ if (d || n.target instanceof HTMLElement && (n.target.tagName === "INPUT" || n.target.tagName === "TEXTAREA" || n.target.isContentEditable || n.target.getAttribute("role") === "textbox") || v || n.ctrlKey || n.metaKey || n.altKey)
494
494
  return;
495
- const O = n.key.toUpperCase(), s = o.find((D) => D.shortcut === O);
496
- s && !s.disabled && (n.preventDefault(), m(s.type, { isSequence: s.isSequence }));
495
+ const O = n.key.toUpperCase(), o = r.find((D) => D.shortcut === O);
496
+ o && !o.disabled && (n.preventDefault(), m(o.type, { isSequence: o.isSequence }));
497
497
  };
498
498
  return window.addEventListener("keydown", h), () => {
499
499
  window.removeEventListener("keydown", h);
500
500
  };
501
- }, [u, o, m, x, i]);
502
- }, xe = E.label`
503
- font-size: ${je.labelMedium};
501
+ }, [u, r, m, v, d]);
502
+ }, we = E.label`
503
+ font-size: ${Fe.labelMedium};
504
504
  color: var(--md-sys-color-outline);
505
- `, Nt = E.span`
505
+ `, Ct = E.span`
506
506
  position: relative;
507
507
  padding: 2px 6px;
508
- font-size: ${je.bodySmall};
508
+ font-size: ${Fe.bodySmall};
509
509
  display: inline-flex;
510
510
  min-height: 20px;
511
511
  gap: var(--base-gap-small);
@@ -522,8 +522,8 @@ const Ct = ({
522
522
  display: flex;
523
523
  }
524
524
  }
525
- `, Et = E(ue)`
526
- font-size: ${je.bodySmall};
525
+ `, Tt = E(he)`
526
+ font-size: ${Fe.bodySmall};
527
527
  width: 100px;
528
528
  max-width: 160px;
529
529
  min-height: 0;
@@ -541,7 +541,7 @@ const Ct = ({
541
541
  outline: 1px solid var(--md-sys-color-primary);
542
542
  }
543
543
  }
544
- `, Fe = E.div`
544
+ `, De = E.div`
545
545
  display: flex;
546
546
  flex-direction: column;
547
547
  align-items: flex-start;
@@ -556,83 +556,83 @@ const Ct = ({
556
556
  font-size: 16px;
557
557
  color: var(--md-sys-color-outline);
558
558
  }
559
- `, Ot = E.div`
559
+ `, Nt = E.div`
560
560
  display: flex;
561
561
  align-items: center;
562
562
  margin-top: 6px;
563
563
  gap: var(--base-gap-small);
564
564
  width: 100%;
565
565
  word-break: break-all;
566
- `, Dt = ({
567
- handleChange: o,
566
+ `, Et = ({
567
+ handleChange: r,
568
568
  entityForm: m,
569
569
  setNameFocused: u,
570
- handleKeyDown: i,
571
- labelRef: x,
570
+ handleKeyDown: d,
571
+ labelRef: v,
572
572
  nameInfo: h = ""
573
573
  }) => {
574
- const [n, O] = $(!1), [s, D] = $(void 0), g = ie(null), F = () => {
574
+ const [n, O] = z(!1), [o, D] = z(void 0), y = ce(null), F = () => {
575
575
  O(!0), u(!0), D(m.name), setTimeout(() => {
576
- g.current && (g.current.focus(), g.current.select());
576
+ y.current && (y.current.focus(), y.current.select());
577
577
  }, 0);
578
- }, M = (l) => {
579
- const A = l.relatedTarget;
580
- (!A || !g.current?.contains(A)) && (O(!1), u(!1), D(void 0));
581
- }, V = (l) => {
582
- if (l.key === "ArrowDown" && !l.altKey || l.key === "Tab") {
583
- l.preventDefault(), F();
578
+ }, A = (s) => {
579
+ const R = s.relatedTarget;
580
+ (!R || !y.current?.contains(R)) && (O(!1), u(!1), D(void 0));
581
+ }, _ = (s) => {
582
+ if (s.key === "ArrowDown" && !s.altKey || s.key === "Tab") {
583
+ s.preventDefault(), F();
584
584
  return;
585
585
  }
586
- i(l, !0);
587
- }, q = (l) => {
588
- if (l.key === "Enter" || l.key === "Escape" || l.key === "ArrowUp" && !l.altKey) {
589
- if (l.stopPropagation(), l.key === "Enter" && !n)
586
+ d(s, !0);
587
+ }, q = (s) => {
588
+ if (s.key === "Enter" || s.key === "Escape" || s.key === "ArrowUp" && !s.altKey) {
589
+ if (s.stopPropagation(), s.key === "Enter" && !n)
590
590
  return F();
591
- l.key === "Escape" && s !== void 0 && o(s, "name"), O(!1), u(!1), D(void 0), setTimeout(() => {
592
- x.current?.focus();
593
- const A = m.label.length || 0;
594
- x.current?.setSelectionRange(A, A);
591
+ s.key === "Escape" && o !== void 0 && r(o, "name"), O(!1), u(!1), D(void 0), setTimeout(() => {
592
+ v.current?.focus();
593
+ const R = m.label.length || 0;
594
+ v.current?.setSelectionRange(R, R);
595
595
  }, 0);
596
596
  return;
597
597
  }
598
598
  };
599
- return /* @__PURE__ */ p(Fe, { style: { flex: 1 }, children: [
600
- /* @__PURE__ */ t(xe, { children: "Label" }),
599
+ return /* @__PURE__ */ p(De, { style: { flex: 1 }, children: [
600
+ /* @__PURE__ */ t(we, { children: "Label" }),
601
601
  /* @__PURE__ */ t(
602
- ue,
602
+ he,
603
603
  {
604
604
  value: m.label,
605
- onChange: (l) => o(l.target.value, "label"),
606
- ref: x,
605
+ onChange: (s) => r(s.target.value, "label"),
606
+ ref: v,
607
607
  onFocus: () => u(!0),
608
- onKeyDown: V,
608
+ onKeyDown: _,
609
609
  style: { flex: 1, width: "100%" }
610
610
  }
611
611
  ),
612
- /* @__PURE__ */ p(Ot, { onKeyDown: q, children: [
613
- /* @__PURE__ */ t(xe, { children: "Name" }),
614
- h && /* @__PURE__ */ t(te, { icon: "info", "data-tooltip": h, "data-tooltip-delay": 0 }),
612
+ /* @__PURE__ */ p(Nt, { onKeyDown: q, children: [
613
+ /* @__PURE__ */ t(we, { children: "Name" }),
614
+ h && /* @__PURE__ */ t(Q, { icon: "info", "data-tooltip": h, "data-tooltip-delay": 0 }),
615
615
  n ? /* @__PURE__ */ t(
616
- Et,
616
+ Tt,
617
617
  {
618
- ref: g,
618
+ ref: y,
619
619
  value: m.name,
620
- onChange: (l) => o(l.target.value, "name"),
621
- onBlur: M,
620
+ onChange: (s) => r(s.target.value, "name"),
621
+ onBlur: A,
622
622
  style: { flex: 1 }
623
623
  }
624
- ) : /* @__PURE__ */ p(Nt, { onClick: F, tabIndex: 0, children: [
624
+ ) : /* @__PURE__ */ p(Ct, { onClick: F, tabIndex: 0, children: [
625
625
  m.name,
626
626
  " ",
627
- /* @__PURE__ */ t(te, { icon: "edit" })
627
+ /* @__PURE__ */ t(Q, { icon: "edit" })
628
628
  ] })
629
629
  ] })
630
630
  ] });
631
- }, qt = E(rt)`
631
+ }, Ot = E(et)`
632
632
  .body {
633
633
  overflow: visible;
634
634
  }
635
- `, Ft = E.div`
635
+ `, Dt = E.div`
636
636
  display: flex;
637
637
  align-items: flex-start;
638
638
  gap: var(--base-gap-large);
@@ -641,7 +641,7 @@ const Ct = ({
641
641
  margin-right: 8px;
642
642
  }
643
643
  }
644
- `, Pt = E(Pe)`
644
+ `, qt = E(qe)`
645
645
  overflow: visible;
646
646
  min-width: fit-content;
647
647
  .button {
@@ -661,12 +661,12 @@ const Ct = ({
661
661
  background-color: var(--md-sys-color-primary-hover);
662
662
  }
663
663
  }
664
- `, ze = E.span`
664
+ `, Ke = E.span`
665
665
  display: flex;
666
666
  align-items: center;
667
667
  min-height: 32px;
668
668
  color: var(--md-sys-color-outline);
669
- `, jt = E.span`
669
+ `, Ft = E.span`
670
670
  display: flex;
671
671
  align-items: center;
672
672
  gap: var(--base-gap-small);
@@ -682,120 +682,115 @@ const Ct = ({
682
682
  &.disabled {
683
683
  opacity: 0.5;
684
684
  }
685
- `, nn = ({
686
- disabled: o,
685
+ `, en = ({
686
+ disabled: r,
687
687
  onNewEntities: m,
688
688
  showButton: u = !0,
689
- showDialog: i = !0,
690
- enableShortcuts: x = !0
689
+ showDialog: d = !0,
690
+ enableShortcuts: v = !0
691
691
  }) => {
692
- const { ...h } = De(), {
692
+ const { ...h } = Ee(), {
693
693
  entityType: n,
694
694
  setEntityType: O,
695
- entityForm: s,
695
+ entityForm: o,
696
696
  setEntityForm: D,
697
- sequenceForm: g,
697
+ sequenceForm: y,
698
698
  setSequenceForm: F,
699
- onCreateNew: M,
700
- onOpenNew: V,
699
+ onCreateNew: A,
700
+ onOpenNew: _,
701
701
  config: q,
702
- parentFolderIds: l
703
- } = Mt(), [A, Z] = $(!1), { selectedCells: K } = ft() || {}, { rowSelection: T, pinnedSlice: G, sliceType: L } = _e(), { getFolderById: Q } = We(), J = pt(), Y = J?.getEntityById, ce = J?.showHierarchy ?? !0, se = ge(() => {
704
- if (l !== null) return l;
705
- const e = K ? Array.from(K).map((N) => ut(N)) : [], y = Array.from(
702
+ parentFolderIds: s
703
+ } = jt(), [R, J] = z(!1), { selectedCells: K } = lt() || {}, x = ft(), { getFolderById: ne } = Be(), W = it(), V = W?.getEntityById, X = W?.showHierarchy ?? !0, ae = ge(() => {
704
+ if (s !== null) return s;
705
+ const e = K ? Array.from(K).map((I) => ct(I)) : [], w = Array.from(
706
706
  new Set(
707
- e.filter((N) => N && N.colId !== Me).map((N) => N?.rowId).filter(Boolean)
707
+ e.filter((I) => I && I.colId !== je).map((I) => I?.rowId).filter(Boolean)
708
708
  )
709
- ), B = Array.from(
709
+ ), L = Array.from(
710
710
  new Set(
711
- e.filter((N) => N?.colId === Me).map((N) => N?.rowId).filter(Boolean)
711
+ e.filter((I) => I?.colId === je).map((I) => I?.rowId).filter(Boolean)
712
712
  )
713
- ), le = y.length > 0 ? y : B;
713
+ ), le = w.length > 0 ? w : L;
714
714
  if (le.length > 0) {
715
- const N = le.map((ee) => Y?.(ee)), Ce = N.filter(
716
- (ee) => ee?.entityType === "folder"
717
- ), Ze = N.filter(
718
- (ee) => ee?.entityType === "task"
719
- ), Re = Array.from(
715
+ const I = le.map((G) => V?.(G)), ie = I.filter(
716
+ (G) => G?.entityType === "folder"
717
+ ), Ie = I.filter(
718
+ (G) => G?.entityType === "task"
719
+ ), Pe = Array.from(
720
720
  /* @__PURE__ */ new Set([
721
- ...Ce.map((ee) => ee.id),
722
- ...Ze.map((ee) => ee.folderId)
721
+ ...ie.map((G) => G.id),
722
+ ...Ie.map((G) => G.folderId)
723
723
  ])
724
724
  );
725
- if (Re.length) return Re;
725
+ if (Pe.length) return Pe;
726
726
  }
727
- const X = L === "hierarchy" ? T : G?.rowSelection || null;
728
- return X ? Object.keys(X).filter((N) => X[N]) : [];
729
- }, [l, K, T, G, L, Y]), ae = ge(() => {
730
- if (l !== null) return l;
731
- const e = L === "hierarchy" ? T : G?.rowSelection || null;
732
- return e ? Object.keys(e).filter((y) => e[y]) : [];
733
- }, [l, T, G, L]), _ = n === "folder" && !ce ? ae : se, W = se.length > 0, a = ge(
734
- () => _.map((e) => {
735
- const y = Y?.(e) || Q(e);
736
- return { value: e, label: y?.label || y?.name || e };
727
+ return x ? Object.keys(x).filter((I) => x[I]) : [];
728
+ }, [s, K, x, V]), de = ge(() => s !== null ? s : x ? Object.keys(x).filter((e) => x[e]) : [], [s, x]), H = n === "folder" && !X ? de : ae, Y = ae.length > 0, ee = ge(
729
+ () => H.map((e) => {
730
+ const w = V?.(e) || ne(e);
731
+ return { value: e, label: w?.label || w?.name || e };
737
732
  }),
738
- [_, Y, Q]
739
- ), [v, S] = $(null);
740
- let f = v !== null ? v : _;
741
- f = f.filter((e) => _.includes(e)), f.length === 0 && _.length > 0 && (f = _);
742
- const r = f.map((e) => a.find((y) => y.value === e)?.label || "").filter(Boolean), b = r[0] || "", c = Ee(_), [I, j] = $(!1), [k, w] = $(!1), R = { label: "", subType: "", name: "" }, d = () => {
733
+ [H, V, ne]
734
+ ), [B, a] = z(null);
735
+ let f = B !== null ? B : H;
736
+ f = f.filter((e) => H.includes(e)), f.length === 0 && H.length > 0 && (f = H);
737
+ const g = f.map((e) => ee.find((w) => w.value === e)?.label || "").filter(Boolean), S = g[0] || "", l = Te(H), [b, i] = z(!1), [C, $] = z(!1), T = { label: "", subType: "", name: "" }, k = () => {
743
738
  let e = "Add New ";
744
- return c && n === "folder" && (e += "Root "), e += n ? ne[n].label : "", c || (r.length > 2 ? e += " - " + r.slice(0, 2).join(", ") + ` +${r.length - 2} more` : e += " - " + r.join(", ")), e;
745
- }, H = (n === "folder" ? h?.folderTypes : h?.taskTypes) || [], z = (e, y) => {
746
- if (!y) return;
747
- let B = { ...s };
748
- if (B[y] = e, e && y === "subType") {
749
- const le = H.find((N) => N.name === s.subType), X = H.find((N) => N.name === e);
750
- if (X && s.label === le?.name) {
751
- B.label = X.name;
752
- const Ce = be(s.label, q);
753
- s.name === Ce && (B.name = be(B.label, q));
739
+ return l && n === "folder" && (e += "Root "), e += n ? te[n].label : "", l || (g.length > 2 ? e += " - " + g.slice(0, 2).join(", ") + ` +${g.length - 2} more` : e += " - " + g.join(", ")), e;
740
+ }, P = (n === "folder" ? h?.folderTypes : h?.taskTypes) || [], c = (e, w) => {
741
+ if (!w) return;
742
+ let L = { ...o };
743
+ if (L[w] = e, e && w === "subType") {
744
+ const le = P.find((ie) => ie.name === o.subType), I = P.find((ie) => ie.name === e);
745
+ if (I && o.label === le?.name) {
746
+ L.label = I.name;
747
+ const Ie = be(o.label, q);
748
+ o.name === Ie && (L.name = be(L.label, q));
754
749
  }
755
750
  setTimeout(() => {
756
- P.current?.focus();
751
+ j.current?.focus();
757
752
  }, 100);
758
- } else y === "label" ? (B.label = e, k || (B.name = be(e, q))) : y === "name" && (w(!0), B.name = e);
759
- D(B);
760
- }, U = (e) => {
761
- D({ ...s, label: e.base, subType: e.type }), F({
762
- ...g,
753
+ } else w === "label" ? (L.label = e, C || (L.name = be(e, q))) : w === "name" && ($(!0), L.name = e);
754
+ D(L);
755
+ }, Z = (e) => {
756
+ D({ ...o, label: e.base, subType: e.type }), F({
757
+ ...y,
763
758
  increment: e.increment,
764
759
  length: e.length,
765
760
  prefix: e.prefix,
766
761
  prefixDepth: e.prefixDepth
767
762
  });
768
- }, C = ie(null), P = ie(null), re = () => {
769
- O(null), D(R), F((e) => ({ ...e, active: !1 })), w(!1), S(null);
770
- }, ve = () => setTimeout(() => C.current?.open(), 180), [me, he] = $(!1), ye = async (e) => {
771
- const y = tt(s.label);
772
- if (!y.valid) {
773
- pe.error(y.error || "Invalid label");
763
+ }, M = ce(null), j = ce(null), N = () => {
764
+ O(null), D(T), F((e) => ({ ...e, active: !1 })), $(!1), a(null);
765
+ }, U = () => setTimeout(() => M.current?.open(), 180), [oe, ye] = z(!1), se = async (e) => {
766
+ const w = Ge(o.label);
767
+ if (!w.valid) {
768
+ me.error(w.error || "Invalid label");
774
769
  return;
775
770
  }
776
- const { valid: B, error: le } = nt(s.name);
777
- if (!B) {
778
- pe.error(le || "Invalid name");
771
+ const { valid: L, error: le } = Qe(o.name);
772
+ if (!L) {
773
+ me.error(le || "Invalid name");
779
774
  return;
780
775
  }
781
- he(!0);
776
+ ye(!0);
782
777
  try {
783
- const X = await M(f);
784
- console.log(X), m?.(X, e), e ? (P.current && (P.current.focus(), P.current.select()), w(!1)) : re();
778
+ const I = await A(f);
779
+ console.log(I), m?.(I, e), e ? (j.current && (j.current.focus(), j.current.select()), $(!1)) : N();
785
780
  } catch {
786
781
  } finally {
787
- he(!1);
782
+ ye(!1);
788
783
  }
789
- }, Se = (e, y) => {
790
- e?.stopPropagation(), e.key === "Enter" ? y && !e.shiftKey || e.ctrlKey || e.metaKey ? (ye(!1), Z(!1)) : e.shiftKey && (ye(!0), Z(!0)) : e.key === "Escape" && re();
791
- }, He = () => {
792
- I && (j(!1), setTimeout(() => {
793
- C.current?.open();
784
+ }, fe = (e, w) => {
785
+ e?.stopPropagation(), e.key === "Enter" ? w && !e.shiftKey || e.ctrlKey || e.metaKey ? (se(!1), J(!1)) : e.shiftKey && (se(!0), J(!0)) : e.key === "Escape" && N();
786
+ }, We = () => {
787
+ b && (i(!1), setTimeout(() => {
788
+ M.current?.open();
794
789
  }, 100));
795
- }, Ie = ge(
790
+ }, ve = ge(
796
791
  () => [
797
792
  {
798
- ...ne.folder,
793
+ ...te.folder,
799
794
  value: "folder",
800
795
  type: "folder",
801
796
  shortcut: "N"
@@ -809,100 +804,100 @@ const Ct = ({
809
804
  isSequence: !0
810
805
  },
811
806
  {
812
- ...ne.task,
807
+ ...te.task,
813
808
  value: "task",
814
809
  type: "task",
815
810
  shortcut: "T",
816
- disabled: !W,
811
+ disabled: !Y,
817
812
  disabledMessage: "Select a folder to create a task in"
818
813
  }
819
814
  ],
820
- [W]
815
+ [Y]
821
816
  );
822
- Tt({ options: Ie, onOpenNew: V, enabled: x });
823
- const Je = (e) => {
824
- const y = Ie.find((B) => B.value === e);
825
- y && !y.disabled && V(y.type, { isSequence: y.isSequence });
826
- }, ke = n === "task" && Ee(f), Xe = !s.label || !s.subType || ke;
827
- return /* @__PURE__ */ p(fe, { children: [
817
+ St({ options: ve, onOpenNew: _, enabled: v });
818
+ const He = (e) => {
819
+ const w = ve.find((L) => L.value === e);
820
+ w && !w.disabled && _(w.type, { isSequence: w.isSequence });
821
+ }, ke = n === "task" && Te(f), Ue = !o.label || !o.subType || ke;
822
+ return /* @__PURE__ */ p(ue, { children: [
828
823
  u && /* @__PURE__ */ t(
829
- Pt,
824
+ qt,
830
825
  {
831
- options: Ie,
826
+ options: ve,
832
827
  value: [],
833
- onChange: (e) => Je(e[0]),
834
- valueTemplate: () => /* @__PURE__ */ p(fe, { children: [
835
- /* @__PURE__ */ t(te, { icon: "add" }),
828
+ onChange: (e) => He(e[0]),
829
+ valueTemplate: () => /* @__PURE__ */ p(ue, { children: [
830
+ /* @__PURE__ */ t(Q, { icon: "add" }),
836
831
  /* @__PURE__ */ t("span", { children: "Create" })
837
832
  ] }),
838
833
  itemTemplate: (e) => /* @__PURE__ */ p(
839
- jt,
834
+ Ft,
840
835
  {
841
836
  className: e.disabled ? "disabled" : void 0,
842
837
  "data-tooltip": e.disabled ? e.disabledMessage : void 0,
843
838
  children: [
844
- /* @__PURE__ */ t(te, { icon: e.icon }),
839
+ /* @__PURE__ */ t(Q, { icon: e.icon }),
845
840
  /* @__PURE__ */ t("span", { className: "label", children: e.label }),
846
- /* @__PURE__ */ t(ot, { children: e.shortcut })
841
+ /* @__PURE__ */ t(tt, { children: e.shortcut })
847
842
  ]
848
843
  }
849
844
  ),
850
845
  itemStyle: {
851
846
  paddingRight: 16
852
847
  },
853
- disabled: o,
848
+ disabled: r,
854
849
  "data-tooltip": "Create new entity"
855
850
  }
856
851
  ),
857
- i && n && /* @__PURE__ */ t(
858
- qt,
852
+ d && n && /* @__PURE__ */ t(
853
+ Ot,
859
854
  {
860
- header: d(),
855
+ header: k(),
861
856
  isOpen: !0,
862
- onClose: re,
863
- onShow: ve,
864
- size: g.active ? "lg" : "md",
865
- style: { maxWidth: g.active ? "unset" : 430 },
857
+ onClose: N,
858
+ onShow: U,
859
+ size: y.active ? "lg" : "md",
860
+ style: { maxWidth: y.active ? "unset" : 430 },
866
861
  enableBackdropClose: !1,
867
- footer: /* @__PURE__ */ p(st, { onFocus: () => j(!1), style: { width: "100%" }, children: [
868
- n === "folder" && /* @__PURE__ */ p(fe, { children: [
862
+ footer: /* @__PURE__ */ p(nt, { onFocus: () => i(!1), style: { width: "100%" }, children: [
863
+ n === "folder" && /* @__PURE__ */ p(ue, { children: [
869
864
  /* @__PURE__ */ t("span", { children: "Sequence" }),
870
865
  /* @__PURE__ */ t(
871
- Oe,
866
+ Ne,
872
867
  {
873
- checked: g.active,
868
+ checked: y.active,
874
869
  onChange: (e) => F({
875
- ...g,
870
+ ...y,
876
871
  active: e.target.checked
877
872
  })
878
873
  }
879
874
  )
880
875
  ] }),
881
- /* @__PURE__ */ t($e, {}),
876
+ /* @__PURE__ */ t(ze, {}),
882
877
  /* @__PURE__ */ t("span", { children: "Create more" }),
883
878
  /* @__PURE__ */ t(
884
- Oe,
879
+ Ne,
885
880
  {
886
- checked: A,
887
- onChange: (e) => Z(e.target.checked)
881
+ checked: R,
882
+ onChange: (e) => J(e.target.checked)
888
883
  }
889
884
  ),
890
885
  /* @__PURE__ */ t(
891
- lt,
886
+ at,
892
887
  {
893
- label: ne[n].createLabel,
894
- onClick: () => ye(A),
895
- active: !Xe || me,
896
- disabled: !s.name || !s.label || ke,
888
+ label: te[n].createLabel,
889
+ onClick: () => se(R),
890
+ active: !Ue || oe,
891
+ disabled: !o.name || !o.label || ke,
897
892
  "data-tooltip": ke ? "Select a parent folder" : void 0,
898
- "data-shortcut": it("Enter", [ct.Ctrl]),
899
- saving: me
893
+ "data-shortcut": rt("Enter", [ot.Ctrl]),
894
+ saving: oe
900
895
  }
901
896
  )
902
897
  ] }),
903
- onKeyDown: (e) => Se(e),
898
+ onKeyDown: (e) => fe(e),
904
899
  onClick: (e) => {
905
- e.target.tagName !== "INPUT" && j(!1);
900
+ e.target.tagName !== "INPUT" && i(!1);
906
901
  },
907
902
  children: /* @__PURE__ */ p(
908
903
  "div",
@@ -913,65 +908,65 @@ const Ct = ({
913
908
  gap: "var(--base-gap-large)"
914
909
  },
915
910
  children: [
916
- /* @__PURE__ */ p(Fe, { children: [
917
- /* @__PURE__ */ t(xe, { children: "Parent folder" }),
918
- _.length > 0 ? /* @__PURE__ */ t(
919
- Pe,
911
+ /* @__PURE__ */ p(De, { children: [
912
+ /* @__PURE__ */ t(we, { children: "Parent folder" }),
913
+ H.length > 0 ? /* @__PURE__ */ t(
914
+ qe,
920
915
  {
921
916
  value: f,
922
- options: a,
923
- onChange: (e) => S(e),
924
- disabled: a.length <= 1,
917
+ options: ee,
918
+ onChange: (e) => a(e),
919
+ disabled: ee.length <= 1,
925
920
  multiSelect: !0,
926
921
  style: { width: "100%", minHeight: 32 }
927
922
  }
928
- ) : n === "task" ? /* @__PURE__ */ t(ze, { children: "Select a folder to create a task in" }) : /* @__PURE__ */ t(ze, { children: "Creating in the project root" })
923
+ ) : n === "task" ? /* @__PURE__ */ t(Ke, { children: "Select a folder to create a task in" }) : /* @__PURE__ */ t(Ke, { children: "Creating in the project root" })
929
924
  ] }),
930
- g.active ? (
925
+ y.active ? (
931
926
  // @ts-ignore
932
927
  /* @__PURE__ */ t(
933
- Ct,
928
+ It,
934
929
  {
935
- base: s.label,
936
- type: s.subType,
937
- increment: g.increment,
938
- length: g.length,
939
- prefix: g.prefix,
940
- prefixDepth: g.prefixDepth,
941
- parentLabel: b,
930
+ base: o.label,
931
+ type: o.subType,
932
+ increment: y.increment,
933
+ length: y.length,
934
+ prefix: y.prefix,
935
+ prefixDepth: y.prefixDepth,
936
+ parentLabel: S,
942
937
  entityType: "folder",
943
938
  nesting: !1,
944
- onChange: U,
945
- isRoot: c,
946
- typeSelectRef: C,
947
- onLastInputKeydown: (e) => Se(e, !0),
939
+ onChange: Z,
940
+ isRoot: l,
941
+ typeSelectRef: M,
942
+ onLastInputKeydown: (e) => fe(e, !0),
948
943
  folders: h?.folderTypes || []
949
944
  }
950
945
  )
951
- ) : /* @__PURE__ */ p(Ft, { children: [
952
- /* @__PURE__ */ p(Fe, { children: [
953
- /* @__PURE__ */ t(xe, { children: "Type" }),
946
+ ) : /* @__PURE__ */ p(Dt, { children: [
947
+ /* @__PURE__ */ p(De, { children: [
948
+ /* @__PURE__ */ t(we, { children: "Type" }),
954
949
  /* @__PURE__ */ t(
955
- we,
950
+ xe,
956
951
  {
957
- value: [s.subType],
958
- onChange: (e) => z(e, "subType"),
959
- options: H,
952
+ value: [o.subType],
953
+ onChange: (e) => c(e, "subType"),
954
+ options: P,
960
955
  style: { width: 160 },
961
- ref: C,
962
- onFocus: He,
963
- onClick: () => j(!1)
956
+ ref: M,
957
+ onFocus: We,
958
+ onClick: () => i(!1)
964
959
  }
965
960
  )
966
961
  ] }),
967
962
  /* @__PURE__ */ t(
968
- Dt,
963
+ Et,
969
964
  {
970
- handleChange: z,
971
- entityForm: s,
972
- labelRef: P,
973
- setNameFocused: j,
974
- handleKeyDown: Se,
965
+ handleChange: c,
966
+ entityForm: o,
967
+ labelRef: j,
968
+ setNameFocused: i,
969
+ handleKeyDown: fe,
975
970
  nameInfo: `Names are auto generated from the label using the Entity Naming setting on the project anatomy. Capitalization: ${q.capitalization}. Separator: "${q.separator}"`
976
971
  }
977
972
  )
@@ -982,31 +977,31 @@ const Ct = ({
982
977
  }
983
978
  )
984
979
  ] });
985
- }, Rt = (o, m, u) => {
986
- if (!o || !m) return "";
987
- const i = (o === "folder" ? u?.folderTypes : u?.taskTypes)?.find(
988
- (x) => x.name === m
980
+ }, Pt = (r, m, u) => {
981
+ if (!r || !m) return "";
982
+ const d = (r === "folder" ? u?.folderTypes : u?.taskTypes)?.find(
983
+ (v) => v.name === m
989
984
  );
990
- return i ? i.name : "";
991
- }, Ve = Ye(void 0), an = ({ children: o }) => {
992
- const { projectName: m, ...u } = De(), { attribFields: i } = mt(), { findNonInheritedValues: x, getFolderById: h } = We(), { attrib: n = {}, statuses: O } = u || {}, { anatomy: s } = De(), { entity_naming: D = { capitalization: "lower", separator: "_" } } = s, { rowSelection: g, sliceType: F } = _e(), M = O?.filter((a) => a.scope?.includes("task"))?.[0]?.name || O?.[0]?.name || "none", V = O?.filter((a) => a.scope?.includes("folder"))?.[0]?.name || O?.[0]?.name || "none", [q, l] = $(null), [A, Z] = $(null), K = { label: "", subType: "", name: "" }, [T, G] = $(K), [L, Q] = $({
985
+ return d ? d.name : "";
986
+ }, _e = Xe(void 0), tn = ({ children: r }) => {
987
+ const { projectName: m, ...u } = Ee(), { attribFields: d } = dt(), { findNonInheritedValues: v, getFolderById: h } = Be(), { attrib: n = {}, statuses: O } = u || {}, { anatomy: o } = Ee(), { entity_naming: D = { capitalization: "lower", separator: "_" } } = o, { rowSelection: y, sliceType: F } = pt(), A = O?.filter((a) => a.scope?.includes("task"))?.[0]?.name || O?.[0]?.name || "none", _ = O?.filter((a) => a.scope?.includes("folder"))?.[0]?.name || O?.[0]?.name || "none", [q, s] = z(null), [R, J] = z(null), K = { label: "", subType: "", name: "" }, [x, ne] = z(K), [W, V] = z({
993
988
  active: !1,
994
989
  increment: "",
995
990
  length: 10,
996
991
  prefix: !1,
997
992
  prefixDepth: 0
998
- }), J = (a, v, S, f) => {
999
- const r = {};
1000
- if (F !== "hierarchy" && !Ee(g) && a === "task") {
1001
- const b = Object.keys(g).filter(
1002
- (c) => !["hasValue", "noValue"].includes(c)
993
+ }), X = (a, f, g, S) => {
994
+ const l = {};
995
+ if (F !== "hierarchy" && !Te(y) && a === "task") {
996
+ const b = Object.keys(y).filter(
997
+ (i) => !["hasValue", "noValue"].includes(i)
1003
998
  );
1004
999
  switch (F) {
1005
1000
  case "assignees":
1006
- r.assignees = b;
1001
+ l.assignees = b;
1007
1002
  break;
1008
1003
  case "status":
1009
- r.status = b[0];
1004
+ l.status = b[0];
1010
1005
  break;
1011
1006
  }
1012
1007
  }
@@ -1014,104 +1009,104 @@ const Ct = ({
1014
1009
  type: "create",
1015
1010
  entityType: a,
1016
1011
  data: {
1017
- [`${a}Type`]: v,
1018
- id: et(),
1019
- label: S.label || S.name,
1020
- name: S.name,
1021
- ...f && { [a === "folder" ? "parentId" : "folderId"]: f },
1022
- ...r
1012
+ [`${a}Type`]: f,
1013
+ id: Ze(),
1014
+ label: g.label || g.name,
1015
+ name: g.name,
1016
+ ...S && { [a === "folder" ? "parentId" : "folderId"]: S },
1017
+ ...l
1023
1018
  }
1024
1019
  };
1025
- }, Y = (a, v, S, f, r) => {
1026
- if (f.length === 0 && a === "folder")
1027
- return S.map((c) => J(a, v, { name: c }));
1020
+ }, ae = (a, f, g, S, l) => {
1021
+ if (S.length === 0 && a === "folder")
1022
+ return g.map((i) => X(a, f, { name: i }));
1028
1023
  const b = [];
1029
- for (const c of f)
1030
- for (const I of S) {
1031
- const j = r ? (c.label || c.name) + I : I;
1032
- b.push(J(a, v, { name: j }, c.id));
1024
+ for (const i of S)
1025
+ for (const C of g) {
1026
+ const $ = l ? (i.label || i.name) + C : C;
1027
+ b.push(X(a, f, { name: $ }, i.id));
1033
1028
  }
1034
1029
  return b;
1035
- }, ce = (a, v, S, f, r) => f.length === 0 && a === "folder" ? [J(a, v, { name: r, label: S })] : f.map(
1036
- (b) => J(a, v, { name: r, label: S }, b)
1037
- ), se = (a, v = {}) => {
1038
- const S = /* @__PURE__ */ new Set();
1039
- for (const k of a)
1040
- if (k.entityType === "folder")
1041
- k.data?.parentId && S.add(k.data.parentId);
1042
- else if (k.entityType === "task") {
1043
- if (!k.data?.folderId) {
1044
- console.warn("Task operation without folderId:", k);
1030
+ }, de = (a, f, g, S, l) => S.length === 0 && a === "folder" ? [X(a, f, { name: l, label: g })] : S.map(
1031
+ (b) => X(a, f, { name: l, label: g }, b)
1032
+ ), H = (a, f = {}) => {
1033
+ const g = /* @__PURE__ */ new Set();
1034
+ for (const T of a)
1035
+ if (T.entityType === "folder")
1036
+ T.data?.parentId && g.add(T.data.parentId);
1037
+ else if (T.entityType === "task") {
1038
+ if (!T.data?.folderId) {
1039
+ console.warn("Task operation without folderId:", T);
1045
1040
  continue;
1046
1041
  }
1047
- S.add(k.data.folderId);
1042
+ g.add(T.data.folderId);
1048
1043
  }
1049
- const f = /* @__PURE__ */ new Map();
1050
- for (const k of S) {
1051
- if (!k) continue;
1052
- const w = x(
1053
- k,
1054
- i.map((R) => R.name)
1044
+ const S = /* @__PURE__ */ new Map();
1045
+ for (const T of g) {
1046
+ if (!T) continue;
1047
+ const k = v(
1048
+ T,
1049
+ d.map((P) => P.name)
1055
1050
  );
1056
- f.set(k, w);
1051
+ S.set(T, k);
1057
1052
  }
1058
- const r = a.filter((k) => k.entityType === "folder"), b = a.filter((k) => k.entityType === "task"), c = (k, w) => {
1059
- let R = [];
1060
- for (const d of k) {
1061
- const H = w === "folder" ? d.data.parentId : d.data.folderId, z = f.get(H) || n, U = Object.keys(z).reduce((C, P) => {
1062
- const re = i.find((he) => he.name === P);
1063
- if (!re) return C;
1064
- const ve = re.scope?.includes(w), me = !!re.data.inherit;
1065
- return ve ? C[P] = z[P] : me && z[P] && (C[P] = {
1066
- ...z[P],
1053
+ const l = a.filter((T) => T.entityType === "folder"), b = a.filter((T) => T.entityType === "task"), i = (T, k) => {
1054
+ let P = [];
1055
+ for (const c of T) {
1056
+ const Z = k === "folder" ? c.data.parentId : c.data.folderId, M = S.get(Z) || n, j = Object.keys(M).reduce((N, U) => {
1057
+ const oe = d.find((fe) => fe.name === U);
1058
+ if (!oe) return N;
1059
+ const ye = oe.scope?.includes(k), se = !!oe.data.inherit;
1060
+ return ye ? N[U] = M[U] : se && M[U] && (N[U] = {
1061
+ ...M[U],
1067
1062
  inherited: !0,
1068
- inheritedFrom: H
1069
- }), C;
1063
+ inheritedFrom: Z
1064
+ }), N;
1070
1065
  }, {});
1071
- if (w === "folder") {
1072
- let C = d.data.parentId && v[d.data.parentId];
1073
- C = C ? C + "/" + d.data.name : "";
1074
- const P = {
1066
+ if (k === "folder") {
1067
+ let N = c.data.parentId && f[c.data.parentId];
1068
+ N = N ? N + "/" + c.data.name : "";
1069
+ const U = {
1075
1070
  type: "create",
1076
1071
  entityType: "folder",
1077
- entityId: d.data.id,
1072
+ entityId: c.data.id,
1078
1073
  data: {
1079
- ...d.data,
1080
- entityId: d.data.id,
1074
+ ...c.data,
1075
+ entityId: c.data.id,
1081
1076
  entityType: "folder",
1082
1077
  projectName: m,
1083
- folderType: d.data.folderType,
1078
+ folderType: c.data.folderType,
1084
1079
  parents: [],
1085
1080
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1086
1081
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1087
- status: V,
1082
+ status: _,
1088
1083
  ownAttrib: [],
1089
- path: C,
1084
+ path: N,
1090
1085
  tags: [],
1091
- attrib: U,
1086
+ attrib: j,
1092
1087
  links: []
1093
1088
  // Add empty links object
1094
1089
  }
1095
1090
  };
1096
- R.push(P);
1091
+ P.push(U);
1097
1092
  } else {
1098
- const C = {
1093
+ const N = {
1099
1094
  type: "create",
1100
1095
  entityType: "task",
1101
- entityId: d.data.id,
1096
+ entityId: c.data.id,
1102
1097
  data: {
1103
- ...d.data,
1104
- entityId: d.data.id,
1098
+ ...c.data,
1099
+ entityId: c.data.id,
1105
1100
  entityType: "task",
1106
- label: d.data.label || d.data.name,
1107
- taskType: d.data.taskType || "",
1108
- folderId: d.data.folderId || "",
1101
+ label: c.data.label || c.data.name,
1102
+ taskType: c.data.taskType || "",
1103
+ folderId: c.data.folderId || "",
1109
1104
  active: !0,
1110
- assignees: d.data.assignees || [],
1105
+ assignees: c.data.assignees || [],
1111
1106
  projectName: m,
1112
- status: d.data.status || M,
1107
+ status: c.data.status || A,
1113
1108
  folder: {
1114
- path: d.data.folderId ? v[d.data.folderId] : "",
1109
+ path: c.data.folderId ? f[c.data.folderId] : "",
1115
1110
  folderType: ""
1116
1111
  },
1117
1112
  tags: [],
@@ -1121,127 +1116,127 @@ const Ct = ({
1121
1116
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1122
1117
  thumbnailHash: "",
1123
1118
  subtasks: [],
1124
- attrib: U,
1119
+ attrib: j,
1125
1120
  hasReviewables: !1,
1126
1121
  // Add required field
1127
1122
  links: [],
1128
1123
  // Add empty links object
1129
- allAttrib: JSON.stringify(U),
1124
+ allAttrib: JSON.stringify(j),
1130
1125
  parents: []
1131
1126
  }
1132
1127
  };
1133
- R.push(C);
1128
+ P.push(N);
1134
1129
  }
1135
1130
  }
1136
- return R;
1137
- }, I = c(
1138
- r,
1131
+ return P;
1132
+ }, C = i(
1133
+ l,
1139
1134
  "folder"
1140
- ), j = c(
1135
+ ), $ = i(
1141
1136
  b,
1142
1137
  "task"
1143
1138
  );
1144
- return [...I, ...j];
1145
- }, [ae] = ht(), _ = async (a) => {
1146
- if (!q || !T.label || !T.name)
1147
- throw pe.error("Please provide a valid name and select an entity type"), new Error("Invalid entity type or label");
1139
+ return [...C, ...$];
1140
+ }, [Y] = ut(), ee = async (a) => {
1141
+ if (!q || !x.label || !x.name)
1142
+ throw me.error("Please provide a valid name and select an entity type"), new Error("Invalid entity type or label");
1148
1143
  if (q === "task" && a.length === 0)
1149
- throw pe.error("Cannot create a task without selecting a folder"), new Error("No folder selected for task creation");
1150
- let v;
1151
- if (L.active) {
1152
- const r = [];
1153
- for (const c of a) {
1154
- const I = h(c);
1155
- I && r.push({
1156
- id: I.id,
1157
- name: I.name,
1158
- label: I.label || I.name
1144
+ throw me.error("Cannot create a task without selecting a folder"), new Error("No folder selected for task creation");
1145
+ let f;
1146
+ if (W.active) {
1147
+ const l = [];
1148
+ for (const i of a) {
1149
+ const C = h(i);
1150
+ C && l.push({
1151
+ id: C.id,
1152
+ name: C.name,
1153
+ label: C.label || C.name
1159
1154
  });
1160
1155
  }
1161
- const b = qe(T.label, L.increment, L.length);
1162
- v = Y(
1156
+ const b = Oe(x.label, W.increment, W.length);
1157
+ f = ae(
1163
1158
  q,
1164
- T.subType,
1159
+ x.subType,
1165
1160
  b,
1166
- r,
1167
- L.prefix
1161
+ l,
1162
+ W.prefix
1168
1163
  );
1169
1164
  } else
1170
- v = ce(
1165
+ f = de(
1171
1166
  q,
1172
- T.subType,
1173
- T.label,
1167
+ x.subType,
1168
+ x.label,
1174
1169
  a,
1175
- T.name
1170
+ x.name
1176
1171
  );
1177
- const S = {};
1178
- for (const r of a) {
1179
- const b = h(r);
1180
- b && (S[b.id] = b.path);
1172
+ const g = {};
1173
+ for (const l of a) {
1174
+ const b = h(l);
1175
+ b && (g[b.id] = b.path);
1181
1176
  }
1182
- const f = se(v, S);
1177
+ const S = H(f, g);
1183
1178
  try {
1184
- const r = await ae({
1185
- operationsRequestModel: { operations: v },
1179
+ const l = await Y({
1180
+ operationsRequestModel: { operations: f },
1186
1181
  projectName: m,
1187
- patchOperations: f
1182
+ patchOperations: S
1188
1183
  }).unwrap();
1189
- if (r?.success && r.operations)
1190
- return r.operations;
1184
+ if (l?.success && l.operations)
1185
+ return l.operations;
1191
1186
  throw {
1192
1187
  error: (
1193
1188
  // @ts-expect-error - res.operations may not be typed
1194
- r?.operations?.[0]?.error || "An error occurred while creating the entity. Please try again."
1189
+ l?.operations?.[0]?.error || "An error occurred while creating the entity. Please try again."
1195
1190
  )
1196
1191
  };
1197
- } catch (r) {
1198
- console.log(r);
1199
- const b = at(r);
1200
- throw pe.error(b), new Error(b);
1192
+ } catch (l) {
1193
+ console.log(l);
1194
+ const b = Ye(l);
1195
+ throw me.error(b), new Error(b);
1201
1196
  }
1202
- }, W = (a, v) => {
1203
- l(a), Z(v?.parentFolderIds ?? null);
1204
- const r = ((a === "folder" ? u?.folderTypes : u?.taskTypes) || [])[0].name || "", b = Rt(a, r, u), c = {
1205
- subType: r,
1197
+ }, B = (a, f) => {
1198
+ s(a), J(f?.parentFolderIds ?? null);
1199
+ const l = ((a === "folder" ? u?.folderTypes : u?.taskTypes) || [])[0].name || "", b = Pt(a, l, u), i = {
1200
+ subType: l,
1206
1201
  label: b,
1207
1202
  name: be(b, D)
1208
1203
  };
1209
- v?.isSequence && Q((I) => ({
1210
- ...I,
1204
+ f?.isSequence && V((C) => ({
1205
+ ...C,
1211
1206
  active: !0
1212
- })), G(c);
1207
+ })), ne(i);
1213
1208
  };
1214
1209
  return /* @__PURE__ */ t(
1215
- Ve.Provider,
1210
+ _e.Provider,
1216
1211
  {
1217
1212
  value: {
1218
1213
  config: D,
1219
1214
  entityType: q,
1220
- setEntityType: l,
1221
- entityForm: T,
1222
- setEntityForm: G,
1223
- sequenceForm: L,
1224
- setSequenceForm: Q,
1225
- onCreateNew: _,
1226
- onOpenNew: W,
1227
- parentFolderIds: A
1215
+ setEntityType: s,
1216
+ entityForm: x,
1217
+ setEntityForm: ne,
1218
+ sequenceForm: W,
1219
+ setSequenceForm: V,
1220
+ onCreateNew: ee,
1221
+ onOpenNew: B,
1222
+ parentFolderIds: R
1228
1223
  },
1229
- children: o
1224
+ children: r
1230
1225
  }
1231
1226
  );
1232
- }, Mt = () => {
1233
- const o = Ne(Ve);
1234
- if (!o)
1227
+ }, jt = () => {
1228
+ const r = Ce(_e);
1229
+ if (!r)
1235
1230
  throw new Error("useNewEntityContext must be used within a NewEntityProvider");
1236
- return o;
1231
+ return r;
1237
1232
  };
1238
1233
  export {
1239
- xe as I,
1240
- Ot as N,
1241
- Fe as a,
1242
- nn as b,
1243
- Dt as c,
1244
- an as d,
1245
- Rt as g,
1246
- Mt as u
1234
+ we as I,
1235
+ Nt as N,
1236
+ De as a,
1237
+ en as b,
1238
+ Et as c,
1239
+ tn as d,
1240
+ Pt as g,
1241
+ jt as u
1247
1242
  };