@ynput/ayon-frontend-shared 0.5.0 → 0.6.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.
Files changed (92) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +307 -311
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +99 -92
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4459 -2959
  7. package/dist/SimpleTable.es.js +8 -7
  8. package/dist/Slicer.es.js +451 -147
  9. package/dist/Views.es.js +918 -310
  10. package/dist/api.es.js +331 -329
  11. package/dist/chunks/Actions.es.js +32 -27
  12. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  13. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  14. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  15. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  16. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  17. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  18. package/dist/chunks/DetailsDialog.es.js +3 -3
  19. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  20. package/dist/chunks/EntityPath.es.js +74 -69
  21. package/dist/chunks/EntityPickerDialog.es.js +25 -21
  22. package/dist/chunks/EntityTooltip.es.js +29 -22
  23. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  24. package/dist/chunks/Feed.es.js +2321 -2668
  25. package/dist/chunks/FilterErrorActions.es.js +25 -229
  26. package/dist/chunks/Menu.es.js +21 -17
  27. package/dist/chunks/MenuContext.es.js +14 -256
  28. package/dist/chunks/MenuItem.es.js +34 -24
  29. package/dist/chunks/MetaWidget.es.js +2895 -4919
  30. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  31. package/dist/chunks/PlayableIcon.es.js +4215 -1179
  32. package/dist/chunks/ProjectContext.es.js +102 -66
  33. package/dist/chunks/RepresentationsList.es.js +4 -4
  34. package/dist/chunks/ReviewablesSelector.es.js +468 -460
  35. package/dist/chunks/SimpleForm.es.js +18 -18
  36. package/dist/chunks/SimpleTable.es.js +15 -13
  37. package/dist/chunks/Slicer.es.js +109 -98
  38. package/dist/chunks/TableSettingsFallback.es.js +22 -10
  39. package/dist/chunks/ThumbnailSimple.es.js +290 -52
  40. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  41. package/dist/chunks/VideoPlayer.es.js +24 -28
  42. package/dist/chunks/Watchers.es.js +669 -644
  43. package/dist/chunks/entityDefinitions.es.js +2 -350
  44. package/dist/chunks/expandRelativeDates.es.js +27 -0
  45. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  46. package/dist/chunks/getBundleMode.es.js +1 -1
  47. package/dist/chunks/getUris.es.js +737 -710
  48. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  49. package/dist/chunks/searchTerms.es.js +179 -174
  50. package/dist/chunks/useAttributeEnums.es.js +9 -9
  51. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  52. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  53. package/dist/chunks/useHierarchySelection.es.js +24 -0
  54. package/dist/chunks/useLoadModule.es.js +74 -0
  55. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  56. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  57. package/dist/chunks/viewUpdateHelper.es.js +74 -57
  58. package/dist/components.es.js +1432 -1001
  59. package/dist/context.es.js +791 -78
  60. package/dist/hooks.es.js +95 -94
  61. package/dist/index.es.js +27 -26
  62. package/dist/types/Actions.d.ts +15 -15
  63. package/dist/types/ContextMenu.d.ts +19 -16
  64. package/dist/types/DetailsPanel.d.ts +110 -17
  65. package/dist/types/EntityPickerDialog.d.ts +15 -15
  66. package/dist/types/Feed.d.ts +19 -16
  67. package/dist/types/ListTable.d.ts +15 -15
  68. package/dist/types/NewEntity.d.ts +24 -18
  69. package/dist/types/ProjectTreeTable.d.ts +34 -123
  70. package/dist/types/RepresentationsList.d.ts +15 -15
  71. package/dist/types/SimpleTable.d.ts +19 -16
  72. package/dist/types/Slicer.d.ts +18 -15
  73. package/dist/types/Views.d.ts +19 -16
  74. package/dist/types/api.d.ts +515 -207
  75. package/dist/types/components.d.ts +84 -20
  76. package/dist/types/context.d.ts +108 -25
  77. package/dist/types/hooks.d.ts +15 -15
  78. package/dist/types/index.d.ts +15 -15
  79. package/dist/types/util.d.ts +20 -15
  80. package/dist/util.es.js +117 -105
  81. package/package.json +16 -4
  82. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  83. package/dist/chunks/GlobalContext.es.js +0 -52
  84. package/dist/chunks/NewEntityContext.es.js +0 -1242
  85. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  86. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  87. package/dist/chunks/VersionUploadContext.es.js +0 -232
  88. package/dist/chunks/ViewsContext.es.js +0 -878
  89. package/dist/chunks/mentionTypeOptions.es.js +0 -15
  90. package/dist/chunks/useColumnDragRestriction.es.js +0 -148
  91. package/dist/chunks/useLocalStorage.es.js +0 -355
  92. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -1,1242 +0,0 @@
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
- import "primereact/confirmdialog";
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
- import E from "styled-components";
11
- import { a as rt, K as ot } from "./platform.es.js";
12
- import "uuid";
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
- if (isNaN(O)) return [];
23
- const o = [];
24
- for (let D = 0; D < u; D++) {
25
- const y = h + D * O, F = r.match(/\d+$/);
26
- if (!F) return [];
27
- const A = String(y).padStart(F[0].length, "0"), _ = r.replace(/\d+$/, A);
28
- o.push(_);
29
- }
30
- return o;
31
- }, xe = Ve(
32
- ({
33
- value: r,
34
- options: m,
35
- onChange: u,
36
- style: d,
37
- mainStyle: v,
38
- disabled: h,
39
- placeholder: n,
40
- isChanged: O,
41
- align: o,
42
- type: D,
43
- ...y
44
- }, F) => /* @__PURE__ */ t(
45
- qe,
46
- {
47
- options: m,
48
- dataKey: "name",
49
- value: r,
50
- valueStyle: d,
51
- onChange: (A) => u(A[0]),
52
- disabled: h,
53
- isChanged: O,
54
- placeholder: n,
55
- widthExpand: !0,
56
- search: !0,
57
- searchFields: ["name"],
58
- emptyMessage: "None Set",
59
- style: v,
60
- align: o,
61
- ref: F,
62
- ...y
63
- }
64
- )
65
- );
66
- xe.displayName = "TypeEditor";
67
- const ht = E.div`
68
- position: relative;
69
- display: flex;
70
- flex-direction: column;
71
- gap: var(--base-gap-small);
72
- width: 100%;
73
- align-items: flex-end;
74
-
75
- .seq {
76
- /* flex: 1; */
77
- flex-grow: 1;
78
- width: 100%;
79
- }
80
-
81
- &.task {
82
- width: 100%;
83
- }
84
- `, $e = E.div`
85
- display: flex;
86
- flex-direction: column;
87
- /* panel */
88
- background-color: var(--md-sys-color-surface-container-high);
89
- padding: 7px 4px;
90
- border-radius: var(--border-radius);
91
- border: 1px solid transparent;
92
- z-index: 10;
93
- width: 100%;
94
-
95
- transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
96
-
97
- &.is-new {
98
- /* highlight new items */
99
- background-color: var(--md-sys-color-secondary-container);
100
- border-color: var(--md-sys-color-primary);
101
- }
102
-
103
- &.no-nesting {
104
- background-color: unset;
105
- border: none;
106
- }
107
-
108
- .icon {
109
- font-size: 20px;
110
- }
111
-
112
- .form > .icon {
113
- padding: 5px 0;
114
- }
115
- `, yt = E($e)`
116
- & > div {
117
- align-items: center;
118
- }
119
-
120
- border-radius: var(--border-radius-l);
121
- padding-bottom: 4px;
122
- padding: 2px 4px;
123
- `, Se = E.div`
124
- display: flex;
125
- flex-direction: row;
126
- align-items: flex-end;
127
- gap: var(--base-gap-small);
128
- width: 100%;
129
- .delete {
130
- margin-left: auto;
131
- }
132
-
133
- strong {
134
- font-weight: 700;
135
- }
136
- `, re = E.div`
137
- display: flex;
138
- flex-direction: column;
139
- width: min-content;
140
-
141
- /* input type number */
142
- #length {
143
- width: 90px;
144
- }
145
-
146
- #prefix {
147
- width: 53px;
148
- }
149
-
150
- label {
151
- width: 100%;
152
- text-overflow: ellipsis;
153
- white-space: nowrap;
154
- }
155
- `, gt = E.div`
156
- display: flex;
157
- flex-direction: column;
158
- gap: var(--base-gap-small);
159
- justify-content: flex-end;
160
-
161
- /* has no children then display none */
162
- &:empty {
163
- display: none;
164
- }
165
- width: 100%;
166
- `, bt = E.div`
167
- display: flex;
168
- flex-direction: row;
169
- align-items: center;
170
- gap: var(--base-gap-small);
171
- width: 100%;
172
- `, xt = E.div`
173
- display: flex;
174
- flex-direction: column;
175
- gap: var(--base-gap-small);
176
- z-index: 10;
177
- `, wt = E.span``, vt = E.span`
178
- background-color: var(--md-sys-color-surface-container-low);
179
- padding: 5px 8px;
180
- border-radius: var(--border-radius);
181
- position: relative;
182
- top: -1px;
183
- right: -3px;
184
-
185
- color: var(--md-sys-color-outline);
186
- min-height: 30px;
187
- `;
188
- function kt(r, m, u = "") {
189
- if (r.length <= m)
190
- return r.map((d) => u + d).join(", ");
191
- {
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
- }
195
- }
196
- function Re(r) {
197
- return r === "Shot" ? {
198
- base: "0010",
199
- increment: "0020",
200
- length: 10,
201
- difference: 10
202
- } : {
203
- base: "001",
204
- increment: "002",
205
- length: 10,
206
- difference: 1
207
- };
208
- }
209
- const It = ({
210
- onChange: r,
211
- parentId: m = null,
212
- children: u,
213
- depth: d,
214
- onNew: v,
215
- index: h,
216
- nesting: n = !0,
217
- isRoot: O,
218
- parentLabel: o,
219
- prefixDisabled: D,
220
- typeSelectRef: y,
221
- onLastInputKeydown: F,
222
- folders: A,
223
- ..._
224
- }) => {
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
- break;
240
- }
241
- for (const N in j)
242
- if (typeof j[N] == "string" && k.base?.toLowerCase().includes(j[N].toLowerCase())) {
243
- P = !0;
244
- break;
245
- }
246
- }
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
- }
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
- }
255
- if (r(
256
- k,
257
- typeof K == "string" ? K : void 0,
258
- V
259
- ), k.base && k.increment && k.length) {
260
- const P = Oe(k.base, k.increment, k.length);
261
- H(P);
262
- }
263
- $ === "type" && setTimeout(X ? () => {
264
- Y.current?.focus(), Y.current?.select();
265
- } : () => {
266
- ee.current?.focus();
267
- }, 50);
268
- }, [a, f] = z(!0);
269
- Le(
270
- () => {
271
- const i = setTimeout(() => {
272
- f(!1);
273
- }, 1e3);
274
- return () => clearTimeout(i);
275
- },
276
- // eslint-disable-next-line react-hooks/exhaustive-deps
277
- []
278
- );
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
- {
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
- /* @__PURE__ */ t("strong", { children: "Task" }),
290
- /* @__PURE__ */ t("label", { children: "Type" }),
291
- /* @__PURE__ */ t(
292
- xe,
293
- {
294
- value: [J],
295
- onChange: (i) => B({ target: { value: i, id: "type" } }),
296
- options: A,
297
- style: { width: 160 },
298
- align: "right"
299
- }
300
- ),
301
- /* @__PURE__ */ t("label", { children: "label" }),
302
- /* @__PURE__ */ t(
303
- he,
304
- {
305
- value: q,
306
- id: "base",
307
- onChange: B,
308
- placeholder: "compositing...",
309
- autoComplete: "off"
310
- }
311
- ),
312
- /* @__PURE__ */ t(
313
- pe,
314
- {
315
- icon: "close",
316
- variant: "text",
317
- onClick: () => r({ id: K, delete: !0 }, m),
318
- className: "delete"
319
- }
320
- )
321
- ] })
322
- }
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
- {
330
- icon: "south",
331
- onClick: () => v?.(null),
332
- label: "Root",
333
- title: "add root folder"
334
- }
335
- ),
336
- /* @__PURE__ */ t(
337
- pe,
338
- {
339
- icon: te.folder.icon,
340
- onClick: () => K && v?.(K, "folder"),
341
- label: d === 0 ? te.folder.label : void 0,
342
- title: "add nested folder"
343
- }
344
- )
345
- ] }),
346
- /* @__PURE__ */ t(
347
- pe,
348
- {
349
- icon: te.task.icon,
350
- onClick: () => K && v?.(K, "task"),
351
- label: d === 0 ? te.task.label : void 0,
352
- title: "add nested task",
353
- style: { width: "max-content", marginLeft: "auto" }
354
- }
355
- )
356
- ] }),
357
- /* @__PURE__ */ p(
358
- $e,
359
- {
360
- className: Ae({ "is-new": a, "no-nesting": !n }),
361
- ref: S,
362
- children: [
363
- /* @__PURE__ */ p(Se, { className: "form folder", children: [
364
- /* @__PURE__ */ p(re, { children: [
365
- /* @__PURE__ */ t("label", { children: "Type" }),
366
- /* @__PURE__ */ t(
367
- xe,
368
- {
369
- value: [J],
370
- onChange: (i) => B({ target: { value: i, id: "type" } }),
371
- options: A,
372
- style: { width: 160 },
373
- align: "right",
374
- ref: y
375
- }
376
- )
377
- ] }),
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
- /* @__PURE__ */ t("label", { children: "Prefix" }),
383
- /* @__PURE__ */ t(
384
- Ne,
385
- {
386
- checked: x,
387
- id: "prefix",
388
- onChange: () => B({ target: { value: !x, id: "prefix" } }),
389
- disabled: X,
390
- ref: ee,
391
- switchStyle: { margin: "4px 0" }
392
- }
393
- )
394
- ] }),
395
- /* @__PURE__ */ t(Q, { icon: "trending_flat" })
396
- ] }),
397
- n && x && /* @__PURE__ */ p(re, { children: [
398
- /* @__PURE__ */ t("label", { children: "Depth" }),
399
- /* @__PURE__ */ t(
400
- Me,
401
- {
402
- value: ne,
403
- id: "prefixDepth",
404
- onChange: B,
405
- max: W?.length,
406
- min: 0
407
- }
408
- )
409
- ] })
410
- ] }),
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
- /* @__PURE__ */ t("label", { children: "First Name" }),
414
- /* @__PURE__ */ t(
415
- he,
416
- {
417
- value: q,
418
- id: "base",
419
- ref: Y,
420
- onChange: B,
421
- placeholder: "ep101...",
422
- autoComplete: "off"
423
- }
424
- )
425
- ] }),
426
- /* @__PURE__ */ t(Q, { icon: "trending_flat" }),
427
- /* @__PURE__ */ p(re, { className: "seq", children: [
428
- /* @__PURE__ */ t("label", { children: "Second Name" }),
429
- /* @__PURE__ */ t(
430
- he,
431
- {
432
- value: s,
433
- id: "increment",
434
- onChange: B,
435
- placeholder: "ep102...",
436
- autoComplete: "off"
437
- }
438
- )
439
- ] }),
440
- /* @__PURE__ */ t(Q, { icon: "trending_flat" }),
441
- /* @__PURE__ */ p(re, { children: [
442
- /* @__PURE__ */ t("label", { children: "Count" }),
443
- /* @__PURE__ */ t(
444
- Me,
445
- {
446
- value: R,
447
- id: "length",
448
- onChange: B,
449
- placeholder: "15...",
450
- min: 2,
451
- onFocus: (i) => i.target.select(),
452
- onKeyDown: F
453
- }
454
- )
455
- ] }),
456
- /* @__PURE__ */ t(ze, {}),
457
- n && /* @__PURE__ */ t(
458
- pe,
459
- {
460
- icon: "close",
461
- variant: "text",
462
- onClick: () => r({ id: K, delete: !0 }),
463
- disabled: d === 0 && h === 0
464
- }
465
- )
466
- ] }),
467
- !n && /* @__PURE__ */ p(wt, { children: [
468
- "Example: ",
469
- g
470
- ] })
471
- ]
472
- }
473
- )
474
- ] }),
475
- n && /* @__PURE__ */ t(
476
- gt,
477
- {
478
- className: "children",
479
- style: { width: l, zIndex: 99 - (d ?? 0) - (h ?? 0) },
480
- children: u
481
- }
482
- )
483
- ] });
484
- }, St = ({
485
- options: r,
486
- onOpenNew: m,
487
- enabled: u = !0
488
- }) => {
489
- const { menuOpen: d } = Ce(mt) || { menuOpen: !1 }, { editingCellId: v } = Ce(st) || { editingCellId: null };
490
- Le(() => {
491
- if (!u) return;
492
- const h = (n) => {
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
- return;
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
- };
498
- return window.addEventListener("keydown", h), () => {
499
- window.removeEventListener("keydown", h);
500
- };
501
- }, [u, r, m, v, d]);
502
- }, we = E.label`
503
- font-size: ${Fe.labelMedium};
504
- color: var(--md-sys-color-outline);
505
- `, Ct = E.span`
506
- position: relative;
507
- padding: 2px 6px;
508
- font-size: ${Fe.bodySmall};
509
- display: inline-flex;
510
- min-height: 20px;
511
- gap: var(--base-gap-small);
512
- cursor: pointer;
513
-
514
- .icon {
515
- display: none;
516
- font-size: 14px;
517
- }
518
- &:hover {
519
- background-color: var(--md-sys-color-surface-container-low);
520
- border-radius: var(--border-radius-m);
521
- .icon {
522
- display: flex;
523
- }
524
- }
525
- `, Tt = E(he)`
526
- font-size: ${Fe.bodySmall};
527
- width: 100px;
528
- max-width: 160px;
529
- min-height: 0;
530
- height: 20px;
531
- border: 0;
532
- padding: 1px 6px;
533
-
534
- input {
535
- color: var(--md-sys-color-outline);
536
- outline: none;
537
-
538
- &:focus {
539
- background: var(--md-sys-color-surface-container-low);
540
- border: none;
541
- outline: 1px solid var(--md-sys-color-primary);
542
- }
543
- }
544
- `, De = E.div`
545
- display: flex;
546
- flex-direction: column;
547
- align-items: flex-start;
548
- gap: var(--base-gap-small);
549
-
550
- label {
551
- white-space: nowrap;
552
- }
553
-
554
- [icon='info'] {
555
- cursor: help;
556
- font-size: 16px;
557
- color: var(--md-sys-color-outline);
558
- }
559
- `, Nt = E.div`
560
- display: flex;
561
- align-items: center;
562
- margin-top: 6px;
563
- gap: var(--base-gap-small);
564
- width: 100%;
565
- word-break: break-all;
566
- `, Et = ({
567
- handleChange: r,
568
- entityForm: m,
569
- setNameFocused: u,
570
- handleKeyDown: d,
571
- labelRef: v,
572
- nameInfo: h = ""
573
- }) => {
574
- const [n, O] = z(!1), [o, D] = z(void 0), y = ce(null), F = () => {
575
- O(!0), u(!0), D(m.name), setTimeout(() => {
576
- y.current && (y.current.focus(), y.current.select());
577
- }, 0);
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
- return;
585
- }
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
- return F();
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
- }, 0);
596
- return;
597
- }
598
- };
599
- return /* @__PURE__ */ p(De, { style: { flex: 1 }, children: [
600
- /* @__PURE__ */ t(we, { children: "Label" }),
601
- /* @__PURE__ */ t(
602
- he,
603
- {
604
- value: m.label,
605
- onChange: (s) => r(s.target.value, "label"),
606
- ref: v,
607
- onFocus: () => u(!0),
608
- onKeyDown: _,
609
- style: { flex: 1, width: "100%" }
610
- }
611
- ),
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
- n ? /* @__PURE__ */ t(
616
- Tt,
617
- {
618
- ref: y,
619
- value: m.name,
620
- onChange: (s) => r(s.target.value, "name"),
621
- onBlur: A,
622
- style: { flex: 1 }
623
- }
624
- ) : /* @__PURE__ */ p(Ct, { onClick: F, tabIndex: 0, children: [
625
- m.name,
626
- " ",
627
- /* @__PURE__ */ t(Q, { icon: "edit" })
628
- ] })
629
- ] })
630
- ] });
631
- }, Ot = E(et)`
632
- .body {
633
- overflow: visible;
634
- }
635
- `, Dt = E.div`
636
- display: flex;
637
- align-items: flex-start;
638
- gap: var(--base-gap-large);
639
- form {
640
- input:first-child {
641
- margin-right: 8px;
642
- }
643
- }
644
- `, qt = E(qe)`
645
- overflow: visible;
646
- min-width: fit-content;
647
- .button {
648
- display: flex;
649
- align-items: center;
650
- gap: var(--base-gap-small);
651
- padding: 0 8px;
652
- background-color: var(--md-sys-color-primary);
653
- &,
654
- .icon {
655
- color: var(--md-sys-color-on-primary);
656
- }
657
- min-width: 100px;
658
- justify-content: center;
659
-
660
- &:hover {
661
- background-color: var(--md-sys-color-primary-hover);
662
- }
663
- }
664
- `, Ke = E.span`
665
- display: flex;
666
- align-items: center;
667
- min-height: 32px;
668
- color: var(--md-sys-color-outline);
669
- `, Ft = E.span`
670
- display: flex;
671
- align-items: center;
672
- gap: var(--base-gap-small);
673
- padding: 0 8px;
674
- height: 32px;
675
- width: 100%;
676
-
677
- .label {
678
- flex: 1;
679
- margin-right: 24px;
680
- }
681
-
682
- &.disabled {
683
- opacity: 0.5;
684
- }
685
- `, en = ({
686
- disabled: r,
687
- onNewEntities: m,
688
- showButton: u = !0,
689
- showDialog: d = !0,
690
- enableShortcuts: v = !0
691
- }) => {
692
- const { ...h } = Ee(), {
693
- entityType: n,
694
- setEntityType: O,
695
- entityForm: o,
696
- setEntityForm: D,
697
- sequenceForm: y,
698
- setSequenceForm: F,
699
- onCreateNew: A,
700
- onOpenNew: _,
701
- config: q,
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
- new Set(
707
- e.filter((I) => I && I.colId !== je).map((I) => I?.rowId).filter(Boolean)
708
- )
709
- ), L = Array.from(
710
- new Set(
711
- e.filter((I) => I?.colId === je).map((I) => I?.rowId).filter(Boolean)
712
- )
713
- ), le = w.length > 0 ? w : L;
714
- if (le.length > 0) {
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
- /* @__PURE__ */ new Set([
721
- ...ie.map((G) => G.id),
722
- ...Ie.map((G) => G.folderId)
723
- ])
724
- );
725
- if (Pe.length) return Pe;
726
- }
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 };
732
- }),
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 = () => {
738
- let e = "Add New ";
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));
749
- }
750
- setTimeout(() => {
751
- j.current?.focus();
752
- }, 100);
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,
758
- increment: e.increment,
759
- length: e.length,
760
- prefix: e.prefix,
761
- prefixDepth: e.prefixDepth
762
- });
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");
769
- return;
770
- }
771
- const { valid: L, error: le } = Qe(o.name);
772
- if (!L) {
773
- me.error(le || "Invalid name");
774
- return;
775
- }
776
- ye(!0);
777
- try {
778
- const I = await A(f);
779
- console.log(I), m?.(I, e), e ? (j.current && (j.current.focus(), j.current.select()), $(!1)) : N();
780
- } catch {
781
- } finally {
782
- ye(!1);
783
- }
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();
789
- }, 100));
790
- }, ve = ge(
791
- () => [
792
- {
793
- ...te.folder,
794
- value: "folder",
795
- type: "folder",
796
- shortcut: "N"
797
- },
798
- {
799
- label: "Folder sequence",
800
- value: "sequence",
801
- type: "folder",
802
- icon: "topic",
803
- shortcut: "M",
804
- isSequence: !0
805
- },
806
- {
807
- ...te.task,
808
- value: "task",
809
- type: "task",
810
- shortcut: "T",
811
- disabled: !Y,
812
- disabledMessage: "Select a folder to create a task in"
813
- }
814
- ],
815
- [Y]
816
- );
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: [
823
- u && /* @__PURE__ */ t(
824
- qt,
825
- {
826
- options: ve,
827
- value: [],
828
- onChange: (e) => He(e[0]),
829
- valueTemplate: () => /* @__PURE__ */ p(ue, { children: [
830
- /* @__PURE__ */ t(Q, { icon: "add" }),
831
- /* @__PURE__ */ t("span", { children: "Create" })
832
- ] }),
833
- itemTemplate: (e) => /* @__PURE__ */ p(
834
- Ft,
835
- {
836
- className: e.disabled ? "disabled" : void 0,
837
- "data-tooltip": e.disabled ? e.disabledMessage : void 0,
838
- children: [
839
- /* @__PURE__ */ t(Q, { icon: e.icon }),
840
- /* @__PURE__ */ t("span", { className: "label", children: e.label }),
841
- /* @__PURE__ */ t(tt, { children: e.shortcut })
842
- ]
843
- }
844
- ),
845
- itemStyle: {
846
- paddingRight: 16
847
- },
848
- disabled: r,
849
- "data-tooltip": "Create new entity"
850
- }
851
- ),
852
- d && n && /* @__PURE__ */ t(
853
- Ot,
854
- {
855
- header: k(),
856
- isOpen: !0,
857
- onClose: N,
858
- onShow: U,
859
- size: y.active ? "lg" : "md",
860
- style: { maxWidth: y.active ? "unset" : 430 },
861
- enableBackdropClose: !1,
862
- footer: /* @__PURE__ */ p(nt, { onFocus: () => i(!1), style: { width: "100%" }, children: [
863
- n === "folder" && /* @__PURE__ */ p(ue, { children: [
864
- /* @__PURE__ */ t("span", { children: "Sequence" }),
865
- /* @__PURE__ */ t(
866
- Ne,
867
- {
868
- checked: y.active,
869
- onChange: (e) => F({
870
- ...y,
871
- active: e.target.checked
872
- })
873
- }
874
- )
875
- ] }),
876
- /* @__PURE__ */ t(ze, {}),
877
- /* @__PURE__ */ t("span", { children: "Create more" }),
878
- /* @__PURE__ */ t(
879
- Ne,
880
- {
881
- checked: R,
882
- onChange: (e) => J(e.target.checked)
883
- }
884
- ),
885
- /* @__PURE__ */ t(
886
- at,
887
- {
888
- label: te[n].createLabel,
889
- onClick: () => se(R),
890
- active: !Ue || oe,
891
- disabled: !o.name || !o.label || ke,
892
- "data-tooltip": ke ? "Select a parent folder" : void 0,
893
- "data-shortcut": rt("Enter", [ot.Ctrl]),
894
- saving: oe
895
- }
896
- )
897
- ] }),
898
- onKeyDown: (e) => fe(e),
899
- onClick: (e) => {
900
- e.target.tagName !== "INPUT" && i(!1);
901
- },
902
- children: /* @__PURE__ */ p(
903
- "div",
904
- {
905
- style: {
906
- display: "flex",
907
- flexDirection: "column",
908
- gap: "var(--base-gap-large)"
909
- },
910
- children: [
911
- /* @__PURE__ */ p(De, { children: [
912
- /* @__PURE__ */ t(we, { children: "Parent folder" }),
913
- H.length > 0 ? /* @__PURE__ */ t(
914
- qe,
915
- {
916
- value: f,
917
- options: ee,
918
- onChange: (e) => a(e),
919
- disabled: ee.length <= 1,
920
- multiSelect: !0,
921
- style: { width: "100%", minHeight: 32 }
922
- }
923
- ) : n === "task" ? /* @__PURE__ */ t(Ke, { children: "Select a folder to create a task in" }) : /* @__PURE__ */ t(Ke, { children: "Creating in the project root" })
924
- ] }),
925
- y.active ? (
926
- // @ts-ignore
927
- /* @__PURE__ */ t(
928
- It,
929
- {
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,
937
- entityType: "folder",
938
- nesting: !1,
939
- onChange: Z,
940
- isRoot: l,
941
- typeSelectRef: M,
942
- onLastInputKeydown: (e) => fe(e, !0),
943
- folders: h?.folderTypes || []
944
- }
945
- )
946
- ) : /* @__PURE__ */ p(Dt, { children: [
947
- /* @__PURE__ */ p(De, { children: [
948
- /* @__PURE__ */ t(we, { children: "Type" }),
949
- /* @__PURE__ */ t(
950
- xe,
951
- {
952
- value: [o.subType],
953
- onChange: (e) => c(e, "subType"),
954
- options: P,
955
- style: { width: 160 },
956
- ref: M,
957
- onFocus: We,
958
- onClick: () => i(!1)
959
- }
960
- )
961
- ] }),
962
- /* @__PURE__ */ t(
963
- Et,
964
- {
965
- handleChange: c,
966
- entityForm: o,
967
- labelRef: j,
968
- setNameFocused: i,
969
- handleKeyDown: fe,
970
- nameInfo: `Names are auto generated from the label using the Entity Naming setting on the project anatomy. Capitalization: ${q.capitalization}. Separator: "${q.separator}"`
971
- }
972
- )
973
- ] })
974
- ]
975
- }
976
- )
977
- }
978
- )
979
- ] });
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
984
- );
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({
988
- active: !1,
989
- increment: "",
990
- length: 10,
991
- prefix: !1,
992
- prefixDepth: 0
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)
998
- );
999
- switch (F) {
1000
- case "assignees":
1001
- l.assignees = b;
1002
- break;
1003
- case "status":
1004
- l.status = b[0];
1005
- break;
1006
- }
1007
- }
1008
- return {
1009
- type: "create",
1010
- entityType: a,
1011
- data: {
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
1018
- }
1019
- };
1020
- }, ae = (a, f, g, S, l) => {
1021
- if (S.length === 0 && a === "folder")
1022
- return g.map((i) => X(a, f, { name: i }));
1023
- const b = [];
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));
1028
- }
1029
- return b;
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);
1040
- continue;
1041
- }
1042
- g.add(T.data.folderId);
1043
- }
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)
1050
- );
1051
- S.set(T, k);
1052
- }
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],
1062
- inherited: !0,
1063
- inheritedFrom: Z
1064
- }), N;
1065
- }, {});
1066
- if (k === "folder") {
1067
- let N = c.data.parentId && f[c.data.parentId];
1068
- N = N ? N + "/" + c.data.name : "";
1069
- const U = {
1070
- type: "create",
1071
- entityType: "folder",
1072
- entityId: c.data.id,
1073
- data: {
1074
- ...c.data,
1075
- entityId: c.data.id,
1076
- entityType: "folder",
1077
- projectName: m,
1078
- folderType: c.data.folderType,
1079
- parents: [],
1080
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1081
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1082
- status: _,
1083
- ownAttrib: [],
1084
- path: N,
1085
- tags: [],
1086
- attrib: j,
1087
- links: []
1088
- // Add empty links object
1089
- }
1090
- };
1091
- P.push(U);
1092
- } else {
1093
- const N = {
1094
- type: "create",
1095
- entityType: "task",
1096
- entityId: c.data.id,
1097
- data: {
1098
- ...c.data,
1099
- entityId: c.data.id,
1100
- entityType: "task",
1101
- label: c.data.label || c.data.name,
1102
- taskType: c.data.taskType || "",
1103
- folderId: c.data.folderId || "",
1104
- active: !0,
1105
- assignees: c.data.assignees || [],
1106
- projectName: m,
1107
- status: c.data.status || A,
1108
- folder: {
1109
- path: c.data.folderId ? f[c.data.folderId] : "",
1110
- folderType: ""
1111
- },
1112
- tags: [],
1113
- ownAttrib: [],
1114
- path: "",
1115
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1116
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1117
- thumbnailHash: "",
1118
- subtasks: [],
1119
- attrib: j,
1120
- hasReviewables: !1,
1121
- // Add required field
1122
- links: [],
1123
- // Add empty links object
1124
- allAttrib: JSON.stringify(j),
1125
- parents: []
1126
- }
1127
- };
1128
- P.push(N);
1129
- }
1130
- }
1131
- return P;
1132
- }, C = i(
1133
- l,
1134
- "folder"
1135
- ), $ = i(
1136
- b,
1137
- "task"
1138
- );
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");
1143
- if (q === "task" && a.length === 0)
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
1154
- });
1155
- }
1156
- const b = Oe(x.label, W.increment, W.length);
1157
- f = ae(
1158
- q,
1159
- x.subType,
1160
- b,
1161
- l,
1162
- W.prefix
1163
- );
1164
- } else
1165
- f = de(
1166
- q,
1167
- x.subType,
1168
- x.label,
1169
- a,
1170
- x.name
1171
- );
1172
- const g = {};
1173
- for (const l of a) {
1174
- const b = h(l);
1175
- b && (g[b.id] = b.path);
1176
- }
1177
- const S = H(f, g);
1178
- try {
1179
- const l = await Y({
1180
- operationsRequestModel: { operations: f },
1181
- projectName: m,
1182
- patchOperations: S
1183
- }).unwrap();
1184
- if (l?.success && l.operations)
1185
- return l.operations;
1186
- throw {
1187
- error: (
1188
- // @ts-expect-error - res.operations may not be typed
1189
- l?.operations?.[0]?.error || "An error occurred while creating the entity. Please try again."
1190
- )
1191
- };
1192
- } catch (l) {
1193
- console.log(l);
1194
- const b = Ye(l);
1195
- throw me.error(b), new Error(b);
1196
- }
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,
1201
- label: b,
1202
- name: be(b, D)
1203
- };
1204
- f?.isSequence && V((C) => ({
1205
- ...C,
1206
- active: !0
1207
- })), ne(i);
1208
- };
1209
- return /* @__PURE__ */ t(
1210
- _e.Provider,
1211
- {
1212
- value: {
1213
- config: D,
1214
- entityType: q,
1215
- setEntityType: s,
1216
- entityForm: x,
1217
- setEntityForm: ne,
1218
- sequenceForm: W,
1219
- setSequenceForm: V,
1220
- onCreateNew: ee,
1221
- onOpenNew: B,
1222
- parentFolderIds: R
1223
- },
1224
- children: r
1225
- }
1226
- );
1227
- }, jt = () => {
1228
- const r = Ce(_e);
1229
- if (!r)
1230
- throw new Error("useNewEntityContext must be used within a NewEntityProvider");
1231
- return r;
1232
- };
1233
- export {
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
1242
- };