@ynput/ayon-frontend-shared 0.7.5 → 0.7.6

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 (37) hide show
  1. package/dist/DetailsPanel.es.js +376 -380
  2. package/dist/ListTable.es.js +2 -2
  3. package/dist/NewEntity.es.js +26 -26
  4. package/dist/ProjectTreeTable.es.js +2521 -2510
  5. package/dist/ProjectsTable.es.js +3 -3
  6. package/dist/Slicer.es.js +32 -32
  7. package/dist/Views.es.js +1 -1
  8. package/dist/chunks/ColumnDropIndicator.es.js +2 -2
  9. package/dist/chunks/ColumnHeaderMenuUI.es.js +1 -1
  10. package/dist/chunks/EntityPath.es.js +1 -1
  11. package/dist/chunks/EntityPickerDialog.es.js +481 -460
  12. package/dist/chunks/EntityTooltip.es.js +1 -1
  13. package/dist/chunks/Feed.es.js +11 -10
  14. package/dist/chunks/FilterErrorActions.es.js +1 -1
  15. package/dist/chunks/GroupSettingsFallback.es.js +2 -2
  16. package/dist/chunks/Menu.es.js +250 -247
  17. package/dist/chunks/MetaWidget.es.js +2 -2
  18. package/dist/chunks/PlayableIcon.es.js +368 -368
  19. package/dist/chunks/ProjectFoldersContext.es.js +237 -0
  20. package/dist/chunks/ReviewablesSelector.es.js +1223 -1170
  21. package/dist/chunks/SimpleTable.es.js +301 -296
  22. package/dist/chunks/Slicer.es.js +418 -410
  23. package/dist/chunks/TableExportContextInstance.es.js +428 -382
  24. package/dist/chunks/ThumbnailUploaderContext.es.js +48 -0
  25. package/dist/chunks/Watchers.es.js +2 -2
  26. package/dist/chunks/{ColumnDropIndicator.styled.es.js → addonColumnTags.es.js} +60 -47
  27. package/dist/components.es.js +1404 -1274
  28. package/dist/context.es.js +559 -657
  29. package/dist/hooks.es.js +2 -2
  30. package/dist/index.es.js +2 -2
  31. package/dist/types/EntityPickerDialog.d.ts +45 -2
  32. package/dist/types/ProjectTreeTable.d.ts +119 -17
  33. package/dist/types/components.d.ts +210 -23
  34. package/dist/types/context.d.ts +8 -0
  35. package/package.json +3 -3
  36. package/dist/chunks/ProjectContext.es.js +0 -158
  37. package/dist/chunks/useQueryArgumentChangeLoading.es.js +0 -11
@@ -1,10 +1,10 @@
1
- import { jsx as p, jsxs as B, Fragment as Re } from "react/jsx-runtime";
2
- import { useCallback as w, createContext as He, useContext as Oe, forwardRef as _e, useState as Ce, useEffect as ce, useMemo as le, useRef as R } from "react";
3
- import { theme as Qe, Button as Ee, Icon as ve, InputText as Ue, Spacer as Je, Dialog as We } from "@ynput/ayon-react-components";
4
- import H from "styled-components";
1
+ import { jsx as g, jsxs as O, Fragment as Re } from "react/jsx-runtime";
2
+ import { useCallback as w, createContext as He, useContext as Oe, forwardRef as _e, useState as Ce, useEffect as ce, useMemo as le, useRef as C } from "react";
3
+ import { theme as Je, Button as Ee, Icon as ve, InputText as Qe, Spacer as Ue, Dialog as We } from "@ynput/ayon-react-components";
4
+ import _ from "styled-components";
5
5
  import { functionalUpdate as Se, useReactTable as Xe, getExpandedRowModel as Ye, getFilteredRowModel as Ge, getCoreRowModel as Ze, flexRender as et, sortingFns as tt } from "@tanstack/react-table";
6
6
  import { useVirtualizer as nt } from "@tanstack/react-virtual";
7
- import T from "clsx";
7
+ import z from "clsx";
8
8
  import { compareItems as ot } from "@tanstack/match-sorter-utils";
9
9
  import "lodash";
10
10
  import "primereact/confirmdialog";
@@ -18,7 +18,7 @@ import "primereact-context/contextmenu";
18
18
  import { u as st } from "./useCreateContextMenu.es.js";
19
19
  import { ContributionView as lt, useContributions as ct, runContribution as dt } from "@ynput/ayon-addon";
20
20
  import { reportContributionError as ut, parseShortcut as pt, matchesShortcut as gt } from "@ynput/ayon-addon/host";
21
- const mt = H.div`
21
+ const mt = _.div`
22
22
  display: flex;
23
23
 
24
24
  height: 100%;
@@ -44,7 +44,7 @@ const mt = H.div`
44
44
  font-size: 32px;
45
45
  }
46
46
  h3 {
47
- ${Qe.titleMedium}
47
+ ${Je.titleMedium}
48
48
  }
49
49
  }
50
50
 
@@ -74,7 +74,7 @@ const mt = H.div`
74
74
  padding: 1px 0px;
75
75
  width: 100%;
76
76
  }
77
- `, ft = H.div`
77
+ `, ft = _.div`
78
78
  width: 100%;
79
79
  min-height: 32px;
80
80
  user-select: none;
@@ -280,7 +280,7 @@ const mt = H.div`
280
280
  border-radius: 2px;
281
281
  }
282
282
  }
283
- `, ht = H(Ee)`
283
+ `, ht = _(Ee)`
284
284
  &.expander {
285
285
  background-color: unset;
286
286
  padding: 2px;
@@ -289,7 +289,7 @@ const mt = H.div`
289
289
  background-color: var(--md-sys-color-surface-container-high-hover);
290
290
  }
291
291
  }
292
- `, Wt = H.div`
292
+ `, Yt = _.div`
293
293
  border-radius: var(--border-radius-m);
294
294
  overflow: hidden;
295
295
  background-color: var(--md-sys-color-surface-container-low);
@@ -299,7 +299,7 @@ const mt = H.div`
299
299
  display: flex;
300
300
  flex-direction: column;
301
301
  position: relative;
302
- `, Xt = H.div`
302
+ `, Gt = _.div`
303
303
  padding: 2px;
304
304
  width: 100%;
305
305
  justify-content: space-between;
@@ -310,7 +310,7 @@ const mt = H.div`
310
310
  gap: var(--base-gap-small);
311
311
 
312
312
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
313
- `, Yt = H(Ee)`
313
+ `, Zt = _(Ee)`
314
314
  background-color: unset !important;
315
315
  z-index: 110;
316
316
  position: relative;
@@ -334,19 +334,19 @@ const mt = H.div`
334
334
  function yt({
335
335
  handleRowSelect: t,
336
336
  handleArrowNavigation: o,
337
- handleRename: s
337
+ handleRename: a
338
338
  }) {
339
339
  return { handleRowKeyDown: w(
340
- (n, g) => {
340
+ (n, u) => {
341
341
  if (["Enter", " "].includes(n.key))
342
- n.preventDefault(), n.stopPropagation(), t(n, g);
342
+ n.preventDefault(), n.stopPropagation(), t(n, u);
343
343
  else if (n.key === "ArrowDown" || n.key === "ArrowUp") {
344
344
  n.preventDefault(), n.stopPropagation();
345
345
  const x = n.key === "ArrowDown" ? "down" : "up";
346
- o?.(x, g, n);
347
- } else n.key.toLowerCase() === "r" && !n.ctrlKey && !n.metaKey && (n.preventDefault(), n.stopPropagation(), s?.(n, g));
346
+ o?.(x, u, n);
347
+ } else n.key.toLowerCase() === "r" && !n.ctrlKey && !n.metaKey && (n.preventDefault(), n.stopPropagation(), a?.(n, u));
348
348
  },
349
- [t, o, s]
349
+ [t, o, a]
350
350
  ) };
351
351
  }
352
352
  const ke = He(void 0), xt = () => {
@@ -354,67 +354,67 @@ const ke = He(void 0), xt = () => {
354
354
  if (t === void 0)
355
355
  throw new Error("useSimpleTableContext must be used within a SimpleTableProvider");
356
356
  return t;
357
- }, Gt = ({ children: t, ...o }) => /* @__PURE__ */ p(ke.Provider, { value: { ...o }, children: t }), bt = ({
357
+ }, en = ({ children: t, ...o }) => /* @__PURE__ */ g(ke.Provider, { value: { ...o }, children: t }), bt = ({
358
358
  isRowExpandable: t,
359
359
  isRowExpanded: o,
360
- enableNonFolderIndent: s = !0,
360
+ enableNonFolderIndent: a = !0,
361
361
  isTableExpandable: d,
362
362
  onExpandClick: n
363
- }) => t ? /* @__PURE__ */ p(
363
+ }) => t ? /* @__PURE__ */ g(
364
364
  ht,
365
365
  {
366
- onClick: (g) => {
367
- g.stopPropagation(), n?.(g);
366
+ onClick: (u) => {
367
+ u.stopPropagation(), n?.(u);
368
368
  },
369
369
  icon: o ? "expand_more" : "chevron_right",
370
370
  className: "expander",
371
371
  style: { cursor: "pointer" }
372
372
  }
373
- ) : d && s && /* @__PURE__ */ p("div", { style: { display: "inline-block", minWidth: 24 } }), wt = _e(
373
+ ) : d && a && /* @__PURE__ */ g("div", { style: { display: "inline-block", minWidth: 24 } }), wt = _e(
374
374
  ({
375
375
  value: t,
376
376
  icon: o,
377
- parents: s,
377
+ parents: a,
378
378
  iconColor: d,
379
379
  iconFilled: n,
380
- img: g,
380
+ img: u,
381
381
  imgShape: x = "square",
382
382
  imgRatio: c,
383
383
  imgPosition: b = "start",
384
- isRowExpandable: C,
385
- isRowExpanded: K,
386
- isTableExpandable: z,
387
- enableNonFolderIndent: G = !0,
388
- onExpandClick: O,
389
- startContent: k,
390
- endContent: _,
391
- badge: F,
392
- actions: A,
393
- isRenaming: D,
394
- renameInitialValue: I,
384
+ isRowExpandable: S,
385
+ isRowExpanded: E,
386
+ isTableExpandable: M,
387
+ enableNonFolderIndent: D = !0,
388
+ onExpandClick: I,
389
+ startContent: K,
390
+ endContent: J,
391
+ badge: N,
392
+ actions: j,
393
+ isRenaming: T,
394
+ renameInitialValue: $,
395
395
  onSubmitRename: Z,
396
396
  onCancelRename: Q,
397
397
  renamePlaceholder: ee,
398
398
  depth: U = 0,
399
- isDisabled: J,
400
- disabledMessage: j,
399
+ isDisabled: W,
400
+ disabledMessage: L,
401
401
  active: de,
402
- inactive: $,
403
- style: W,
402
+ inactive: P,
403
+ style: X,
404
404
  pt: y,
405
405
  ...te
406
406
  }, ne) => {
407
- const [oe, X] = Ce(I ?? t);
407
+ const [oe, Y] = Ce($ ?? t);
408
408
  ce(() => {
409
- D && X(I ?? t);
410
- }, [t, D, I]);
411
- const Y = g ? /* @__PURE__ */ p(
409
+ T && Y($ ?? t);
410
+ }, [t, T, $]);
411
+ const G = u ? /* @__PURE__ */ g(
412
412
  "img",
413
413
  {
414
- src: g,
414
+ src: u,
415
415
  ...y?.img,
416
416
  alt: "",
417
- className: T("image", x, `img-${b}`, y?.img?.className),
417
+ className: z("image", x, `img-${b}`, y?.img?.className),
418
418
  style: {
419
419
  aspectRatio: (c ?? 1).toString(),
420
420
  ...y?.img?.style
@@ -422,10 +422,10 @@ const ke = He(void 0), xt = () => {
422
422
  }
423
423
  ) : (
424
424
  // keep the slot so rows don't shift when a thumbnail is missing
425
- c !== void 0 && /* @__PURE__ */ p(
425
+ c !== void 0 && /* @__PURE__ */ g(
426
426
  "div",
427
427
  {
428
- className: T("image", x, `img-${b}`, y?.img?.className),
428
+ className: z("image", x, `img-${b}`, y?.img?.className),
429
429
  style: {
430
430
  aspectRatio: c.toString(),
431
431
  ...y?.img?.style
@@ -433,40 +433,40 @@ const ke = He(void 0), xt = () => {
433
433
  }
434
434
  )
435
435
  );
436
- return /* @__PURE__ */ B(
436
+ return /* @__PURE__ */ O(
437
437
  ft,
438
438
  {
439
439
  ...te,
440
440
  ref: ne,
441
- className: T(te.className, {
442
- disabled: J,
443
- inactive: $ || de === !1,
444
- "has-actions": !!A?.length
441
+ className: z(te.className, {
442
+ disabled: W,
443
+ inactive: P || de === !1,
444
+ "has-actions": !!j?.length
445
445
  }),
446
446
  style: {
447
- ...W,
447
+ ...X,
448
448
  paddingLeft: `calc(${U * 1.5}rem + 4px)`
449
449
  },
450
- title: J ? j : void 0,
450
+ title: W ? L : void 0,
451
451
  children: [
452
- /* @__PURE__ */ p(
452
+ /* @__PURE__ */ g(
453
453
  bt,
454
454
  {
455
- isRowExpandable: C,
456
- isRowExpanded: K,
457
- isTableExpandable: z,
458
- onExpandClick: O,
459
- enableNonFolderIndent: G,
455
+ isRowExpandable: S,
456
+ isRowExpanded: E,
457
+ isTableExpandable: M,
458
+ onExpandClick: I,
459
+ enableNonFolderIndent: D,
460
460
  ...y?.expander
461
461
  }
462
462
  ),
463
- b === "start" && Y,
464
- k,
465
- o && /* @__PURE__ */ p(
463
+ b === "start" && G,
464
+ K,
465
+ o && /* @__PURE__ */ g(
466
466
  ve,
467
467
  {
468
468
  icon: o,
469
- className: T({ filled: n }, y?.icon?.className),
469
+ className: z({ filled: n }, y?.icon?.className),
470
470
  style: {
471
471
  color: d,
472
472
  ...y?.icon?.style
@@ -474,12 +474,12 @@ const ke = He(void 0), xt = () => {
474
474
  ...y?.icon
475
475
  }
476
476
  ),
477
- D ? /* @__PURE__ */ p(
478
- Ue,
477
+ T ? /* @__PURE__ */ g(
478
+ Qe,
479
479
  {
480
480
  autoFocus: !0,
481
481
  style: { flex: 1 },
482
- onChange: (v) => X(v.target.value),
482
+ onChange: (v) => Y(v.target.value),
483
483
  value: oe,
484
484
  placeholder: ee,
485
485
  onKeyDown: (v) => {
@@ -493,30 +493,30 @@ const ke = He(void 0), xt = () => {
493
493
  },
494
494
  ...y?.input
495
495
  }
496
- ) : /* @__PURE__ */ B("div", { className: "text", ...y?.text, children: [
497
- s && U === 0 && /* @__PURE__ */ B("span", { className: "path", children: [
498
- s.join(" / "),
496
+ ) : /* @__PURE__ */ O("div", { className: "text", ...y?.text, children: [
497
+ a && U === 0 && /* @__PURE__ */ O("span", { className: "path", children: [
498
+ a.join(" / "),
499
499
  " / "
500
500
  ] }),
501
- /* @__PURE__ */ p("span", { className: "value", children: t })
501
+ /* @__PURE__ */ g("span", { className: "value", children: t })
502
502
  ] }),
503
- !D && /* @__PURE__ */ B(Re, { children: [
504
- /* @__PURE__ */ p(Je, { className: "spacer" }),
505
- F?.toString() && /* @__PURE__ */ p("div", { className: "badges", children: typeof F == "string" ? /* @__PURE__ */ p("span", { children: F }) : F }),
506
- A && /* @__PURE__ */ p("div", { className: "actions", children: A.map((v, M) => {
507
- const { show: E = "hover", ...N } = v;
508
- return E === "hidden" ? null : /* @__PURE__ */ p(
503
+ !T && /* @__PURE__ */ O(Re, { children: [
504
+ /* @__PURE__ */ g(Ue, { className: "spacer" }),
505
+ N?.toString() && /* @__PURE__ */ g("div", { className: "badges", children: typeof N == "string" ? /* @__PURE__ */ g("span", { children: N }) : N }),
506
+ j && /* @__PURE__ */ g("div", { className: "actions", children: j.map((v, F) => {
507
+ const { show: k = "hover", ...A } = v;
508
+ return k === "hidden" ? null : /* @__PURE__ */ g(
509
509
  ve,
510
510
  {
511
- ...N,
512
- className: T(N.className, { "show-always": E === "always" })
511
+ ...A,
512
+ className: z(A.className, { "show-always": k === "always" })
513
513
  },
514
- N.icon + M.toString()
514
+ A.icon + F.toString()
515
515
  );
516
516
  }) })
517
517
  ] }),
518
- b === "end" && Y,
519
- _ && _
518
+ b === "end" && G,
519
+ J && J
520
520
  ]
521
521
  }
522
522
  );
@@ -524,192 +524,195 @@ const ke = He(void 0), xt = () => {
524
524
  ), vt = ({
525
525
  contribution: t,
526
526
  error: o,
527
- onReported: s
527
+ onReported: a
528
528
  }) => (ce(() => {
529
- ut(t, o), s();
530
- }, [t, o, s]), null), St = ({ contribution: t, context: o }) => {
531
- const s = t;
532
- return /* @__PURE__ */ p(
529
+ ut(t, o), a();
530
+ }, [t, o, a]), null), St = ({ contribution: t, context: o }) => {
531
+ const a = t;
532
+ return /* @__PURE__ */ g(
533
533
  We,
534
534
  {
535
535
  isOpen: !0,
536
- header: String(s.dialogTitle || s.label || s.id),
537
- size: s.dialogSize || "md",
536
+ header: String(a.dialogTitle || a.label || a.id),
537
+ size: a.dialogSize || "md",
538
538
  onClose: o.close,
539
- children: /* @__PURE__ */ p(
539
+ children: /* @__PURE__ */ g(
540
540
  lt,
541
541
  {
542
542
  contribution: t,
543
543
  piece: "dialog",
544
544
  context: o,
545
- error: (d) => /* @__PURE__ */ p(vt, { contribution: s, error: d, onReported: o.close })
545
+ error: (d) => /* @__PURE__ */ g(vt, { contribution: a, error: d, onReported: o.close })
546
546
  }
547
547
  )
548
548
  }
549
549
  );
550
- }, Rt = (t) => {
551
- const { contributions: o } = ct("table.shortcut"), [s, d] = Ce(null), n = le(
550
+ }, Rt = ["overview", "products", "lists"], Ct = (t, o, a) => Rt.includes(t) && o ? a.flatMap(
551
+ ({ id: d, entityType: n, name: u, label: x }) => n ? [{ id: d, entityType: n, projectName: o, name: u, label: x }] : []
552
+ ) : [], Et = (t) => {
553
+ const { contributions: o } = ct("table.shortcut"), [a, d] = Ce(null), n = le(
552
554
  () => t ? o.flatMap((c) => {
553
- const b = pt(c.keys), C = !c.tables?.length || c.tables.includes(t);
554
- return b && C ? [{ contribution: c, shortcut: b }] : [];
555
+ const b = pt(c.keys), S = !c.tables?.length || c.tables.includes(t);
556
+ return b && S ? [{ contribution: c, shortcut: b }] : [];
555
557
  }) : [],
556
558
  [o, t]
557
- ), g = w(
559
+ ), u = w(
558
560
  (c, b) => {
559
- c.dialog ? d({ contribution: c, context: { ...b, close: () => d(null) } }) : dt(c, b);
561
+ const { table: S, projectName: E, rows: M } = b, D = { ...b, entities: Ct(S, E, M) };
562
+ c.dialog ? d({ contribution: c, context: { ...D, close: () => d(null) } }) : dt(c, D);
560
563
  },
561
564
  []
562
565
  ), x = w(
563
566
  (c, b) => {
564
567
  if (!t || c.repeat) return !1;
565
- const C = n.find(({ shortcut: z }) => gt(c, z));
566
- if (!C) return !1;
567
- const K = b();
568
- return K?.rows.length ? (c.preventDefault(), c.stopPropagation(), g(C.contribution, { ...K, table: t }), !0) : !1;
568
+ const S = n.find(({ shortcut: M }) => gt(c, M));
569
+ if (!S) return !1;
570
+ const E = b();
571
+ return E?.rows.length ? (c.preventDefault(), c.stopPropagation(), u(S.contribution, { ...E, table: t }), !0) : !1;
569
572
  },
570
- [n, t, g]
573
+ [n, t, u]
571
574
  );
572
- return { hasShortcuts: n.length > 0, handleShortcut: x, runShortcut: g, dialog: s };
573
- }, Ct = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : [t] : [], Ke = (t, o) => {
574
- t.toggleExpanded(o), t.subRows.forEach((s) => Ke(s, o));
575
- }, Me = (t, o, s, d) => {
575
+ return { hasShortcuts: n.length > 0, handleShortcut: x, runShortcut: u, dialog: a };
576
+ }, kt = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : [t] : [], Ke = (t, o) => {
577
+ t.toggleExpanded(o), t.subRows.forEach((a) => Ke(a, o));
578
+ }, Me = (t, o, a, d) => {
576
579
  const n = t.getValue(o);
577
- let g = typeof n == "string" ? n : Array.isArray(n) ? n.join(" ") : JSON.stringify(n);
578
- o === "label" && (g = [t.original.label, t.original.name, ...t.original.parents || []].join(
580
+ let u = typeof n == "string" ? n : Array.isArray(n) ? n.join(" ") : JSON.stringify(n);
581
+ o === "label" && (u = [t.original.label, t.original.name, ...t.original.parents || []].join(
579
582
  " "
580
583
  ));
581
- const x = rt(g, s);
584
+ const x = rt(u, a);
582
585
  return d({ itemRank: x }), x.passed;
583
586
  };
584
587
  Me.resolveFilterValue = at;
585
- const Et = (t, o, s) => {
588
+ const Kt = (t, o, a) => {
586
589
  let d = 0;
587
- return t.columnFiltersMeta[s] && (d = ot(
588
- t.columnFiltersMeta[s]?.itemRank,
589
- o.columnFiltersMeta[s]?.itemRank
590
- )), d === 0 ? tt.alphanumeric(t, o, s) : d;
590
+ return t.columnFiltersMeta[a] && (d = ot(
591
+ t.columnFiltersMeta[a]?.itemRank,
592
+ o.columnFiltersMeta[a]?.itemRank
593
+ )), d === 0 ? tt.alphanumeric(t, o, a) : d;
591
594
  };
592
- function kt(t, o, s) {
595
+ function Mt(t, o, a) {
593
596
  let d = -1, n = -1;
594
- for (let c = 0; c < t.length && (t[c].id === o && (d = c), t[c].id === s && (n = c), !(d !== -1 && n !== -1)); c++)
597
+ for (let c = 0; c < t.length && (t[c].id === o && (d = c), t[c].id === a && (n = c), !(d !== -1 && n !== -1)); c++)
595
598
  ;
596
599
  if (d === -1 || n === -1) return [];
597
- const g = Math.min(d, n), x = Math.max(d, n);
598
- return t.slice(g, x + 1);
600
+ const u = Math.min(d, n), x = Math.max(d, n);
601
+ return t.slice(u, x + 1);
599
602
  }
600
- const Zt = ({
603
+ const tn = ({
601
604
  data: t = [],
602
605
  isLoading: o,
603
- error: s,
606
+ error: a,
604
607
  isExpandable: d,
605
608
  isMultiSelect: n = !0,
606
- enableClickToDeselect: g = !0,
609
+ enableClickToDeselect: u = !0,
607
610
  enableNonFolderIndent: x = !0,
608
611
  forceUpdateTable: c,
609
612
  globalFilter: b,
610
- meta: C,
611
- rowHeight: K,
612
- imgRatio: z,
613
- imgPosition: G,
614
- onScrollBottom: O,
615
- scrollToRowId: k,
616
- onRename: _,
617
- renamingId: F,
618
- renameInitialValue: A,
619
- onSubmitRename: D,
620
- onCancelRename: I,
613
+ meta: S,
614
+ rowHeight: E,
615
+ imgRatio: M,
616
+ imgPosition: D,
617
+ onScrollBottom: I,
618
+ scrollToRowId: K,
619
+ onRename: J,
620
+ renamingId: N,
621
+ renameInitialValue: j,
622
+ onSubmitRename: T,
623
+ onCancelRename: $,
621
624
  onRowDoubleClick: Z,
622
625
  onRowOptionClick: Q,
623
626
  rowContextMenuBuilders: ee = [],
624
627
  addonShortcuts: U,
625
- children: J,
626
- pt: j,
628
+ children: W,
629
+ pt: L,
627
630
  fitContent: de,
628
- rowIdPrefix: $,
629
- ...W
631
+ rowIdPrefix: P,
632
+ ...X
630
633
  }) => {
631
634
  const {
632
635
  rowSelection: y,
633
636
  expanded: te,
634
637
  setExpanded: ne,
635
638
  onExpandedChange: oe,
636
- onRowSelectionChange: X,
637
- rowPinning: Y,
639
+ onRowSelectionChange: Y,
640
+ rowPinning: G,
638
641
  onRowPinningChange: v
639
- } = xt(), M = R(null), E = R(null), N = R($);
640
- N.current = $;
641
- const re = (e) => N.current ? `${N.current}-${e}` : e, [ge] = st(), me = R(Z);
642
+ } = xt(), F = C(null), k = C(null), A = C(P);
643
+ A.current = P;
644
+ const re = (e) => A.current ? `${A.current}-${e}` : e, [ge] = st(), me = C(Z);
642
645
  me.current = Z;
643
- const ue = R(F);
644
- ue.current = F;
645
- const fe = R(A);
646
- fe.current = A;
647
- const pe = R(D);
648
- pe.current = D;
649
- const he = R(I);
650
- he.current = I;
651
- const ye = R(_);
652
- ye.current = _;
653
- const Fe = le(() => o ? Array.from({ length: 10 }, (e, a) => ({
654
- id: `placeholder-${a}`,
655
- name: `placeholder-${a}`,
656
- label: `placeholder-${a}`,
646
+ const ue = C(N);
647
+ ue.current = N;
648
+ const fe = C(j);
649
+ fe.current = j;
650
+ const pe = C(T);
651
+ pe.current = T;
652
+ const he = C($);
653
+ he.current = $;
654
+ const ye = C(J);
655
+ ye.current = J;
656
+ const Fe = le(() => o ? Array.from({ length: 10 }, (e, i) => ({
657
+ id: `placeholder-${i}`,
658
+ name: `placeholder-${i}`,
659
+ label: `placeholder-${i}`,
657
660
  icon: null,
658
661
  img: null,
659
662
  subRows: [],
660
663
  data: {
661
- id: `placeholder-${a}`
664
+ id: `placeholder-${i}`
662
665
  }
663
- })) : t, [o, t, c]), L = w(
664
- (e, a, i, u) => {
665
- const m = a, f = e.getRowModel(), r = f.rows, S = f.rowsById[m], h = e.getState().rowSelection || {};
666
- if (!S) return { ...h };
667
- if (S.original.isDisabled)
666
+ })) : t, [o, t, c]), B = w(
667
+ (e, i, s, p) => {
668
+ const m = i, f = e.getRowModel(), r = f.rows, R = f.rowsById[m], h = e.getState().rowSelection || {};
669
+ if (!R) return { ...h };
670
+ if (R.original.isDisabled)
668
671
  return { ...h };
669
- if (g && !i && !u && Object.keys(h).length === 1 && h[m])
670
- return e.setRowSelection({}), M.current = null, {};
672
+ if (u && !s && !p && Object.keys(h).length === 1 && h[m])
673
+ return e.setRowSelection({}), F.current = null, {};
671
674
  let l;
672
- if (n && i && M.current) {
673
- const se = M.current, we = kt(r, m, se);
674
- we.length === 0 ? l = { ...h, [m]: !0 } : (l = { ...h }, we.forEach((Be) => l[Be.id] = !0));
675
- } else n && u ? (l = { ...h }, l[m] ? delete l[m] : l[m] = !0) : (l = { ...h }, Object.keys(l).length === 1 && l[m] || (l = { [m]: !0 }));
676
- return e.setRowSelection(l), M.current = m, l;
675
+ if (n && s && F.current) {
676
+ const se = F.current, we = Mt(r, m, se);
677
+ we.length === 0 ? l = { ...h, [m]: !0 } : (l = { ...h }, we.forEach((qe) => l[qe.id] = !0));
678
+ } else n && p ? (l = { ...h }, l[m] ? delete l[m] : l[m] = !0) : (l = { ...h }, Object.keys(l).length === 1 && l[m] || (l = { [m]: !0 }));
679
+ return e.setRowSelection(l), F.current = m, l;
677
680
  },
678
- [n, g]
681
+ [n, u]
679
682
  ), De = w(
680
- (e, a) => {
681
- if (!E.current) {
683
+ (e, i) => {
684
+ if (!k.current) {
682
685
  console.warn("tableRef not yet available in handleRowSelectForKeydown");
683
686
  return;
684
687
  }
685
- const i = e.shiftKey, u = e.ctrlKey || e.metaKey;
686
- L(
687
- E.current,
688
+ const s = e.shiftKey, p = e.ctrlKey || e.metaKey;
689
+ B(
690
+ k.current,
688
691
  // Pass the main table instance
689
- a.id,
690
- i,
691
- u
692
+ i.id,
693
+ s,
694
+ p
692
695
  );
693
696
  },
694
- [L]
697
+ [B]
695
698
  // Depends only on handleSelectionLogic
696
699
  ), Ne = w(
697
- (e, a, i) => {
698
- if (!E.current) return;
699
- const u = E.current.getRowModel().rows, m = u.findIndex((r) => r.id === a.id);
700
+ (e, i, s) => {
701
+ if (!k.current) return;
702
+ const p = k.current.getRowModel().rows, m = p.findIndex((r) => r.id === i.id);
700
703
  if (m === -1) return;
701
704
  let f = e === "down" ? m + 1 : m - 1;
702
- if (!(f < 0 || f >= u.length))
703
- for (; f >= 0 && f < u.length; ) {
704
- const r = u[f];
705
+ if (!(f < 0 || f >= p.length))
706
+ for (; f >= 0 && f < p.length; ) {
707
+ const r = p[f];
705
708
  if (!r.original.isDisabled) {
706
- L(
707
- E.current,
709
+ B(
710
+ k.current,
708
711
  r.id,
709
- i.shiftKey,
710
- i.ctrlKey || i.metaKey
712
+ s.shiftKey,
713
+ s.ctrlKey || s.metaKey
711
714
  ), requestAnimationFrame(() => {
712
- const S = ae.current, l = (S ? S.querySelector(`#${CSS.escape(re(r.id))}`) : document.getElementById(re(r.id)))?.querySelector('[tabindex="0"]');
715
+ const R = ae.current, l = (R ? R.querySelector(`#${CSS.escape(re(r.id))}`) : document.getElementById(re(r.id)))?.querySelector('[tabindex="0"]');
713
716
  l && (l.focus(), l.scrollIntoView({ block: "nearest", behavior: "smooth" }));
714
717
  });
715
718
  return;
@@ -717,10 +720,10 @@ const Zt = ({
717
720
  f = e === "down" ? f + 1 : f - 1;
718
721
  }
719
722
  },
720
- [L]
723
+ [B]
721
724
  ), Te = w(
722
- (e, a) => {
723
- a.original.isDisabled || ye.current?.(a.id, a);
725
+ (e, i) => {
726
+ i.original.isDisabled || ye.current?.(i.id, i);
724
727
  },
725
728
  []
726
729
  // eslint-disable-line react-hooks/exhaustive-deps
@@ -728,20 +731,20 @@ const Zt = ({
728
731
  handleRowSelect: De,
729
732
  handleArrowNavigation: Ne,
730
733
  handleRename: Te
731
- }), ze = le(
734
+ }), Ae = le(
732
735
  () => [
733
736
  {
734
737
  accessorKey: "label",
735
738
  header: void 0,
736
739
  filterFn: "fuzzy",
737
- sortingFn: Et,
740
+ sortingFn: Kt,
738
741
  //sort by fuzzy rank (falls back to alphanumeric)
739
- cell: ({ row: e, getValue: a, table: i }) => {
740
- const u = i.options.meta, m = (r) => {
742
+ cell: ({ row: e, getValue: i, table: s }) => {
743
+ const p = s.options.meta, m = (r) => {
741
744
  if (r.target instanceof HTMLInputElement || r.target instanceof HTMLButtonElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement || r.target instanceof HTMLAnchorElement || r.target.closest("button, a, input, textarea, select"))
742
745
  return;
743
- const h = r.altKey && e.getIsSelected() && !r.shiftKey && !r.ctrlKey && !r.metaKey ? i.getState().rowSelection || {} : L(
744
- i,
746
+ const h = r.altKey && e.getIsSelected() && !r.shiftKey && !r.ctrlKey && !r.metaKey ? s.getState().rowSelection || {} : B(
747
+ s,
745
748
  // Pass the cell's table instance
746
749
  e.id,
747
750
  r.shiftKey,
@@ -749,9 +752,9 @@ const Zt = ({
749
752
  );
750
753
  r.altKey && Q?.(e.original, Object.keys(h));
751
754
  }, f = {
752
- className: T({
755
+ className: z({
753
756
  selected: e.getIsSelected(),
754
- loading: u?.isLoading,
757
+ loading: p?.isLoading,
755
758
  disabled: e.original.isDisabled,
756
759
  // you can't select disabled rows
757
760
  inactive: e.original.inactive
@@ -762,19 +765,19 @@ const Zt = ({
762
765
  },
763
766
  depth: e.depth,
764
767
  tabIndex: 0,
765
- value: a(),
768
+ value: i(),
766
769
  parents: e.original.parents,
767
770
  icon: e.original.icon || void 0,
768
771
  iconColor: e.original.iconColor,
769
772
  iconFilled: e.original.iconFilled,
770
773
  img: e.original.img,
771
774
  imgShape: e.original.imgShape,
772
- imgRatio: z,
773
- imgPosition: G,
775
+ imgRatio: M,
776
+ imgPosition: D,
774
777
  isRowExpandable: e.getCanExpand(),
775
778
  enableNonFolderIndent: x,
776
779
  isRowExpanded: e.getIsExpanded(),
777
- isTableExpandable: u?.isExpandable,
780
+ isTableExpandable: p?.isExpandable,
778
781
  onExpandClick: (r) => {
779
782
  r?.altKey ? Ke(e, !e.getIsExpanded()) : e.toggleExpanded();
780
783
  },
@@ -787,53 +790,53 @@ const Zt = ({
787
790
  renameInitialValue: e.id === ue.current ? fe.current : void 0,
788
791
  onSubmitRename: pe.current ? (r) => pe.current(e.id, r) : void 0,
789
792
  onCancelRename: he.current,
790
- ...j?.cell,
793
+ ...L?.cell,
791
794
  onClick: m,
792
795
  // Added onClick handler
793
796
  onDoubleClick: (r) => me.current?.(e.id, e)
794
797
  };
795
- return u?.children ? u.children(f, e, i) : /* @__PURE__ */ p(wt, { ...f, ...j?.cell });
798
+ return p?.children ? p.children(f, e, s) : /* @__PURE__ */ g(wt, { ...f, ...L?.cell });
796
799
  }
797
800
  }
798
801
  ],
799
802
  [
800
803
  c,
801
- L,
804
+ B,
802
805
  xe,
803
- g,
806
+ u,
804
807
  x,
805
- z,
806
- G,
808
+ M,
809
+ D,
807
810
  Q
808
811
  ]
809
- ), Ae = w(
812
+ ), ze = w(
810
813
  (e) => {
811
- X(Se(e, y));
814
+ Y(Se(e, y));
812
815
  },
813
- [X]
816
+ [Y]
814
817
  ), Ie = w(
815
818
  (e) => {
816
- v?.(Se(e, Y || {}));
819
+ v?.(Se(e, G || {}));
817
820
  },
818
821
  [v]
819
822
  ), je = w(
820
823
  (e) => {
821
- ne?.((a) => {
822
- const i = e instanceof Function ? e(a) : e;
823
- return oe?.(i), i;
824
+ ne?.((i) => {
825
+ const s = e instanceof Function ? e(i) : e;
826
+ return oe?.(s), s;
824
827
  });
825
828
  },
826
829
  [ne]
827
- ), P = Xe({
830
+ ), V = Xe({
828
831
  data: Fe,
829
- columns: ze,
832
+ columns: Ae,
830
833
  state: {
831
834
  expanded: te,
832
835
  rowSelection: y,
833
836
  globalFilter: b,
834
- rowPinning: Y
837
+ rowPinning: G
835
838
  },
836
- onRowSelectionChange: Ae,
839
+ onRowSelectionChange: ze,
837
840
  onRowPinningChange: Ie,
838
841
  filterFns: {
839
842
  fuzzy: Me
@@ -857,92 +860,92 @@ const Zt = ({
857
860
  () => ({
858
861
  isExpandable: !!d,
859
862
  isLoading: o,
860
- children: J,
861
- ...C
863
+ children: W,
864
+ ...S
862
865
  }),
863
- [d, o, J, C]
866
+ [d, o, W, S]
864
867
  )
865
868
  });
866
869
  ce(() => {
867
- E.current = P;
868
- }, [P]);
869
- const { rows: V } = P.getRowModel(), $e = w(
870
- (e, a, i) => {
871
- if (!E.current) return;
872
- const u = V[a];
873
- if (!u || u.original === void 0) return;
874
- i.preventDefault(), i.stopPropagation();
875
- const m = Object.keys(y), f = m.includes(e), r = f ? m : [e], S = ee.flatMap(
876
- (h) => Ct(
877
- h(i, {
870
+ k.current = V;
871
+ }, [V]);
872
+ const { rows: q } = V.getRowModel(), $e = w(
873
+ (e, i, s) => {
874
+ if (!k.current) return;
875
+ const p = q[i];
876
+ if (!p || p.original === void 0) return;
877
+ s.preventDefault(), s.stopPropagation();
878
+ const m = Object.keys(y), f = m.includes(e), r = f ? m : [e], R = ee.flatMap(
879
+ (h) => kt(
880
+ h(s, {
878
881
  rowId: e,
879
- rowIndex: a,
880
- row: u,
882
+ rowIndex: i,
883
+ row: p,
881
884
  selectedRows: r,
882
- selectedTableRows: r.map((l) => P.getRowModel().rowsById[l]).filter((l) => !!l),
885
+ selectedTableRows: r.map((l) => V.getRowModel().rowsById[l]).filter((l) => !!l),
883
886
  isSelected: f
884
887
  })
885
888
  )
886
889
  );
887
- S.length > 0 && ge(i, S);
890
+ R.length > 0 && ge(s, R);
888
891
  },
889
- [ee, V, y, ge]
890
- ), ae = R(null), q = nt({
891
- count: V.length,
892
- estimateSize: () => K || 34,
892
+ [ee, q, y, ge]
893
+ ), ae = C(null), H = nt({
894
+ count: q.length,
895
+ estimateSize: () => E || 34,
893
896
  //estimate row height for accurate scrollbar dragging
894
897
  getScrollElement: () => ae.current,
895
898
  //measure dynamic row height, except in firefox because it measures table border height incorrectly
896
- measureElement: K ? () => K : typeof window < "u" && navigator.userAgent.indexOf("Firefox") === -1 ? (e) => e?.getBoundingClientRect().height : void 0,
899
+ measureElement: E ? () => E : typeof window < "u" && navigator.userAgent.indexOf("Firefox") === -1 ? (e) => e?.getBoundingClientRect().height : void 0,
897
900
  overscan: 5
898
- }), be = R(void 0);
901
+ }), be = C(void 0);
899
902
  ce(() => {
900
- if (!k || be.current === k) return;
901
- const e = V.findIndex((a) => a.id === k);
902
- e < 0 || (be.current = k, M.current = k, q.scrollToIndex(e, { align: "center" }), requestAnimationFrame(
903
+ if (!K || be.current === K) return;
904
+ const e = q.findIndex((i) => i.id === K);
905
+ e < 0 || (be.current = K, F.current = K, H.scrollToIndex(e, { align: "center" }), requestAnimationFrame(
903
906
  () => requestAnimationFrame(() => {
904
907
  ae.current?.querySelector(
905
- `#${CSS.escape(re(k))}`
908
+ `#${CSS.escape(re(K))}`
906
909
  )?.querySelector('[tabindex="0"]')?.focus({ preventScroll: !0 });
907
910
  })
908
911
  ));
909
- }, [k, V, q]);
912
+ }, [K, q, H]);
910
913
  const Le = w(
911
914
  (e) => {
912
- e && q.measureElement(e);
915
+ e && H.measureElement(e);
913
916
  },
914
- [q]
917
+ [H]
915
918
  ), Pe = w(
916
919
  (e) => {
917
- if (!O) return;
918
- const a = e.currentTarget, { scrollTop: i, scrollHeight: u, clientHeight: m } = a;
919
- u - i - m < 100 && !o && O();
920
+ if (!I) return;
921
+ const i = e.currentTarget, { scrollTop: s, scrollHeight: p, clientHeight: m } = i;
922
+ p - s - m < 100 && !o && I();
920
923
  },
921
- [O, o]
924
+ [I, o]
922
925
  ), {
923
- hasShortcuts: Ve,
924
- handleShortcut: qe,
926
+ hasShortcuts: Be,
927
+ handleShortcut: Ve,
925
928
  dialog: ie
926
- } = Rt(U?.table);
927
- return /* @__PURE__ */ B(Re, { children: [
928
- /* @__PURE__ */ B(
929
+ } = Et(U?.table);
930
+ return /* @__PURE__ */ O(Re, { children: [
931
+ /* @__PURE__ */ O(
929
932
  mt,
930
933
  {
931
934
  ref: ae,
932
935
  onScroll: Pe,
933
936
  onClick: (e) => {
934
- g && !e.target.closest("tr") && (P.setRowSelection({}), M.current = null);
937
+ u && !e.target.closest("tr") && (V.setRowSelection({}), F.current = null);
935
938
  },
936
- ...W,
939
+ ...X,
937
940
  onKeyDown: (e) => {
938
- W.onKeyDown?.(e);
939
- const a = e.target;
940
- if (!Ve || ie || e.defaultPrevented || ["INPUT", "TEXTAREA"].includes(a.tagName) || a.isContentEditable) return;
941
- const i = a.closest("tr")?.id;
942
- if (!i) return;
943
- const u = $ ? i.slice($.length + 1) : i;
944
- qe(e, () => {
945
- const { rowsById: m } = P.getRowModel(), f = (h) => {
941
+ X.onKeyDown?.(e);
942
+ const i = e.target;
943
+ if (!Be || ie || e.defaultPrevented || ["INPUT", "TEXTAREA"].includes(i.tagName) || i.isContentEditable) return;
944
+ const s = i.closest("tr")?.id;
945
+ if (!s) return;
946
+ const p = P ? s.slice(P.length + 1) : s;
947
+ Ve(e, () => {
948
+ const { rowsById: m } = V.getRowModel(), f = (h) => {
946
949
  const l = m[h]?.original;
947
950
  if (!l) return;
948
951
  const { entityType: se } = l.data;
@@ -953,67 +956,69 @@ const Zt = ({
953
956
  label: l.label,
954
957
  data: l.data
955
958
  };
956
- }, r = Object.keys(y).filter((h) => y[h]), S = r.includes(u) ? r : [u];
959
+ }, r = Object.keys(y).filter((h) => y[h]), R = r.includes(p) ? r : [p];
957
960
  return {
958
961
  projectName: U?.projectName ?? null,
959
- rows: S.flatMap((h) => f(h) || []),
960
- focused: { rowId: u },
962
+ rows: R.flatMap((h) => f(h) || []),
963
+ focused: { rowId: p },
961
964
  cells: []
962
965
  };
963
966
  });
964
967
  },
965
- className: T(W.className, { isLoading: o, fitContent: de }),
968
+ className: z(X.className, { isLoading: o, fitContent: de }),
966
969
  children: [
967
- !s && /* @__PURE__ */ p("table", { children: /* @__PURE__ */ p(
970
+ !a && /* @__PURE__ */ g("table", { children: /* @__PURE__ */ g(
968
971
  "tbody",
969
972
  {
970
973
  style: {
971
- height: `${q?.getTotalSize()}px`
974
+ height: `${H?.getTotalSize()}px`
972
975
  //tells scrollbar how big the table is
973
976
  },
974
- children: q?.getVirtualItems().map((e) => {
975
- const a = V[e.index];
976
- return /* @__PURE__ */ p(
977
+ children: H?.getVirtualItems().map((e) => {
978
+ const i = q[e.index];
979
+ return /* @__PURE__ */ g(
977
980
  "tr",
978
981
  {
979
982
  "data-index": e.index,
980
983
  ref: Le,
981
- id: re(a.id),
982
- onContextMenu: (i) => $e(a.id, e.index, i),
983
- ...j?.row,
984
+ id: re(i.id),
985
+ onContextMenu: (s) => $e(i.id, e.index, s),
986
+ ...L?.row,
984
987
  style: {
985
988
  transform: `translateY(${e.start}px)`,
986
989
  //this should always be a `style` as it changes on scroll
987
- ...j?.row?.style
990
+ ...L?.row?.style
988
991
  // custom styles to be passed
989
992
  },
990
- children: a.getVisibleCells().map((i) => /* @__PURE__ */ p("td", { children: et(i.column.columnDef.cell, i.getContext()) }, i.id))
993
+ children: i.getVisibleCells().map((s) => /* @__PURE__ */ g("td", { children: et(s.column.columnDef.cell, s.getContext()) }, s.id))
991
994
  },
992
- a.id
995
+ i.id
993
996
  );
994
997
  })
995
998
  }
996
999
  ) }),
997
- !!s && /* @__PURE__ */ p(it, { error: s })
1000
+ !!a && /* @__PURE__ */ g(it, { error: a })
998
1001
  ]
999
1002
  }
1000
1003
  ),
1001
- ie && /* @__PURE__ */ p(St, { contribution: ie.contribution, context: ie.context })
1004
+ ie && /* @__PURE__ */ g(St, { contribution: ie.contribution, context: ie.context })
1002
1005
  ] });
1003
1006
  };
1004
1007
  export {
1005
1008
  St as A,
1006
1009
  ft as C,
1007
1010
  ht as E,
1008
- Xt as H,
1011
+ Gt as H,
1009
1012
  bt as R,
1010
- Zt as S,
1013
+ tn as S,
1011
1014
  mt as T,
1012
- Wt as a,
1013
- Yt as b,
1015
+ Yt as a,
1016
+ Zt as b,
1014
1017
  wt as c,
1015
1018
  ke as d,
1016
- Gt as e,
1017
- Rt as f,
1019
+ en as e,
1020
+ vt as f,
1021
+ Et as g,
1022
+ Ct as s,
1018
1023
  xt as u
1019
1024
  };