wcz-layout 10.1.2 → 10.1.7

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 (85) hide show
  1. package/dist/{AggregatedCell-C7nAQyMO.mjs → AggregatedCell-CqGptV6i.mjs} +199 -150
  2. package/dist/AggregatedCell-CqGptV6i.mjs.map +1 -0
  3. package/dist/Approval-DoD-GRRH.mjs.map +1 -1
  4. package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
  5. package/dist/Email-BzQQkbe9.mjs.map +1 -1
  6. package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
  7. package/dist/{LayoutTable-DX9IaO8V.d.mts → LayoutTable-CRo43iWr.d.mts} +7 -3
  8. package/dist/{RouterListItemButton-ULMlaQh6.mjs → RouterListItemButton-ke6iPKkL.mjs} +9 -9
  9. package/dist/RouterListItemButton-ke6iPKkL.mjs.map +1 -0
  10. package/dist/{approval-DiNOXd4B.mjs → approval-L09uPzTU.mjs} +2 -2
  11. package/dist/approval-L09uPzTU.mjs.map +1 -0
  12. package/dist/auth.d.mts +1 -0
  13. package/dist/auth.mjs +15 -12
  14. package/dist/auth.mjs.map +1 -1
  15. package/dist/components.d.mts +1 -1
  16. package/dist/components.mjs +594 -361
  17. package/dist/components.mjs.map +1 -1
  18. package/dist/{createApi-DGJJ4I_R.mjs → createApi-BhNkG4jz.mjs} +3 -3
  19. package/dist/createApi-BhNkG4jz.mjs.map +1 -0
  20. package/dist/data/client.mjs +3 -3
  21. package/dist/data/client.mjs.map +1 -1
  22. package/dist/data/server.mjs +4 -4
  23. package/dist/data/server.mjs.map +1 -1
  24. package/dist/{file-C14fhUeg.mjs → file-Chlljz3o.mjs} +4 -4
  25. package/dist/file-Chlljz3o.mjs.map +1 -0
  26. package/dist/{file-C5BOj1q8.mjs → file-Dl8JCcqy.mjs} +4 -4
  27. package/dist/file-Dl8JCcqy.mjs.map +1 -0
  28. package/dist/hooks.d.mts +2 -1
  29. package/dist/hooks.mjs +541 -591
  30. package/dist/hooks.mjs.map +1 -1
  31. package/dist/index.d.mts +9 -0
  32. package/dist/index.mjs +438 -428
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/middleware.mjs +2 -2
  35. package/dist/middleware.mjs.map +1 -1
  36. package/dist/models.mjs.map +1 -1
  37. package/dist/{peoplesoft-BkJMCcHb.mjs → peoplesoft-BhintHQz.mjs} +3 -3
  38. package/dist/peoplesoft-BhintHQz.mjs.map +1 -0
  39. package/dist/{providers-DrairEO2.mjs → providers-BvuZWkpD.mjs} +2 -2
  40. package/dist/providers-BvuZWkpD.mjs.map +1 -0
  41. package/dist/{tokens-BLRreL1j.mjs → tokens-XuFhVbh5.mjs} +9 -6
  42. package/dist/tokens-XuFhVbh5.mjs.map +1 -0
  43. package/dist/{utils-BUpDoqme.mjs → utils-CaeVFWF-.mjs} +18 -7
  44. package/dist/utils-CaeVFWF-.mjs.map +1 -0
  45. package/dist/utils.mjs +1 -1
  46. package/dist/vite.mjs +11 -0
  47. package/dist/vite.mjs.map +1 -1
  48. package/package.json +131 -130
  49. package/skills/client-db/SKILL.md +136 -136
  50. package/skills/db-schema/SKILL.md +98 -98
  51. package/skills/dialogs/SKILL.md +74 -74
  52. package/skills/forms/SKILL.md +122 -122
  53. package/skills/general/SKILL.md +127 -127
  54. package/skills/general/references/exports.md +6 -1
  55. package/skills/migrations/SKILL.md +57 -57
  56. package/skills/migrations/versions/migrate-v10-to-v11.md +2 -1
  57. package/skills/migrations/versions/migrate-v9-to-v10.md +582 -582
  58. package/skills/routing/SKILL.md +87 -87
  59. package/skills/server-functions/SKILL.md +95 -95
  60. package/skills/services/SKILL.md +34 -34
  61. package/skills/services/docs/email.md +32 -32
  62. package/skills/services/docs/file.md +108 -108
  63. package/skills/services/docs/peoplesoft.md +114 -114
  64. package/skills/start/SKILL.md +52 -52
  65. package/skills/start/steps/01-git-setup.md +10 -10
  66. package/skills/start/steps/02-project-name-setup.md +19 -19
  67. package/skills/start/steps/03-apm-setup.md +97 -208
  68. package/skills/start/steps/04-wicop-setup.md +105 -105
  69. package/skills/start/steps/05-database-setup.md +52 -52
  70. package/skills/start/steps/06-entra-setup.md +96 -96
  71. package/skills/start/steps/07-vault-setup.md +115 -115
  72. package/skills/start/steps/08-generate-favicon.md +8 -8
  73. package/skills/start/steps/09-gitlab-ci.md +25 -25
  74. package/skills/start/steps/10-commit.md +15 -15
  75. package/skills/table/SKILL.md +266 -264
  76. package/dist/AggregatedCell-C7nAQyMO.mjs.map +0 -1
  77. package/dist/RouterListItemButton-ULMlaQh6.mjs.map +0 -1
  78. package/dist/approval-DiNOXd4B.mjs.map +0 -1
  79. package/dist/createApi-DGJJ4I_R.mjs.map +0 -1
  80. package/dist/file-C14fhUeg.mjs.map +0 -1
  81. package/dist/file-C5BOj1q8.mjs.map +0 -1
  82. package/dist/peoplesoft-BkJMCcHb.mjs.map +0 -1
  83. package/dist/providers-DrairEO2.mjs.map +0 -1
  84. package/dist/tokens-BLRreL1j.mjs.map +0 -1
  85. package/dist/utils-BUpDoqme.mjs.map +0 -1
@@ -1,14 +1,15 @@
1
- import { d as sanitizeReturnTo, m as loginProvidersQueryOptions } from "./utils-BUpDoqme.mjs";
2
- import { n as RouterIconButton, t as RouterListItemButton } from "./RouterListItemButton-ULMlaQh6.mjs";
3
- import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-C14fhUeg.mjs";
4
- import { _ as pinnedSx, b as useDialogs, d as columnAlign, f as columnFlex, h as lookaheadRange, m as hasColumnLabel, t as AggregatedCell, u as cellSelectionSx, y as toClipboardText } from "./AggregatedCell-C7nAQyMO.mjs";
1
+ import { d as sanitizeReturnTo, m as loginProvidersQueryOptions } from "./utils-CaeVFWF-.mjs";
2
+ import { n as RouterIconButton, t as RouterListItemButton } from "./RouterListItemButton-ke6iPKkL.mjs";
3
+ import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-Chlljz3o.mjs";
4
+ import { S as useDialogs, a as columnFlex, c as lookaheadRange, f as toClipboardText, i as columnAlign, p as DEFAULT_PAGE_SIZE_OPTIONS, r as cellSelectionSx, s as hasColumnLabel, t as AggregatedCell, u as pinnedSx } from "./AggregatedCell-CqGptV6i.mjs";
5
5
  import { c } from "react/compiler-runtime";
6
- import { Box, Button, Card, CardContent, CircularProgress, Dialog, Divider, Fab, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItemButton, ListItemIcon, ListItemText, Menu, Paper, Skeleton, Stack, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableRow, Tooltip, Typography, alpha, useTheme } from "@mui/material";
6
+ import { Box, Button, ButtonBase, Card, CardContent, CircularProgress, Dialog, Divider, Fab, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Menu, MenuItem, Paper, Skeleton, Stack, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableRow, Tooltip, Typography, alpha, useTheme } from "@mui/material";
7
7
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
8
8
  import React, { Fragment, createContext, useContext, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
9
9
  import { useTranslation } from "react-i18next";
10
10
  import { manifest } from "virtual:wcz-layout";
11
11
  import { createLink, rootRouteId, useLocation, useMatch } from "@tanstack/react-router";
12
+ import ChevronRight from "@mui/icons-material/ChevronRight";
12
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
14
  import Close from "@mui/icons-material/Close";
14
15
  import CloudQueue from "@mui/icons-material/CloudQueue";
@@ -23,6 +24,7 @@ import FileDownload from "@mui/icons-material/FileDownload";
23
24
  import AttachFile from "@mui/icons-material/AttachFile";
24
25
  import Image from "@mui/icons-material/Image";
25
26
  import SmartDisplay from "@mui/icons-material/SmartDisplay";
27
+ import ChevronLeft from "@mui/icons-material/ChevronLeft";
26
28
  import { useHotkeys } from "@tanstack/react-hotkeys";
27
29
  import { useVirtualizer } from "@tanstack/react-virtual";
28
30
  //#region src/components/core/account/LoginForm.tsx
@@ -37,9 +39,9 @@ const PROVIDER_ICON = {
37
39
  */
38
40
  const LoginForm = () => {
39
41
  const $ = c(36);
40
- if ($[0] !== "768688d2a6d9f6d1b08467771ab00d6ca2dc6a32d0233a10821cfaf230752138") {
42
+ if ($[0] !== "5f14f2dd7f994bdd88840e3f375e9ee4b049c4d266a9eaf4b3e2533ff17cc7c6") {
41
43
  for (let $i = 0; $i < 36; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
42
- $[0] = "768688d2a6d9f6d1b08467771ab00d6ca2dc6a32d0233a10821cfaf230752138";
44
+ $[0] = "5f14f2dd7f994bdd88840e3f375e9ee4b049c4d266a9eaf4b3e2533ff17cc7c6";
43
45
  }
44
46
  const { data: t0 } = useQuery(loginProvidersQueryOptions);
45
47
  let t1;
@@ -51,7 +53,7 @@ const LoginForm = () => {
51
53
  const providers = t1;
52
54
  let t2;
53
55
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
54
- t2 = { select: _temp$1 };
56
+ t2 = { select: _temp$2 };
55
57
  $[3] = t2;
56
58
  } else t2 = $[3];
57
59
  const search = useLocation(t2);
@@ -119,7 +121,7 @@ const LoginForm = () => {
119
121
  t11 = /* @__PURE__ */ jsx(Box, {
120
122
  component: "img",
121
123
  src: "/android-chrome-192x192.png",
122
- alt: manifest.name,
124
+ alt: "",
123
125
  width: 48,
124
126
  height: 48
125
127
  });
@@ -160,6 +162,7 @@ const LoginForm = () => {
160
162
  spacing: .25,
161
163
  children: [t12, /* @__PURE__ */ jsx(Typography, {
162
164
  variant: "h5",
165
+ component: "h1",
163
166
  sx: t13,
164
167
  children: t14
165
168
  })]
@@ -240,7 +243,7 @@ const LoginForm = () => {
240
243
  } else t19 = $[35];
241
244
  return t19;
242
245
  };
243
- function _temp$1(location) {
246
+ function _temp$2(location) {
244
247
  return location.search;
245
248
  }
246
249
  function _temp2(theme) {
@@ -260,11 +263,25 @@ function _temp3(theme_0) {
260
263
  }
261
264
  //#endregion
262
265
  //#region src/components/core/Fullscreen.tsx
266
+ const isScrollContainer = (element) => /auto|scroll|overlay/.test(getComputedStyle(element).overflowY);
267
+ /** Ancestors up to and including the nearest scroll container (or the root element). */
268
+ const getAncestors = (element) => {
269
+ const ancestors = [];
270
+ let parent = element.parentElement;
271
+ while (parent && parent !== document.body && parent !== document.documentElement) {
272
+ ancestors.push(parent);
273
+ if (isScrollContainer(parent)) return ancestors;
274
+ parent = parent.parentElement;
275
+ }
276
+ ancestors.push(document.documentElement);
277
+ return ancestors;
278
+ };
279
+ const px = (value) => Number.parseFloat(value) || 0;
263
280
  const Fullscreen = (t0) => {
264
281
  const $ = c(16);
265
- if ($[0] !== "2243979894039564df2fd1f70562faf7a7d5878eaeea3b472ad974fd8b0c233e") {
282
+ if ($[0] !== "8cbf7a32d40cad26f487ed7c5e0b8451044a6d7e404e9591bd3919c6daa7488f") {
266
283
  for (let $i = 0; $i < 16; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
267
- $[0] = "2243979894039564df2fd1f70562faf7a7d5878eaeea3b472ad974fd8b0c233e";
284
+ $[0] = "8cbf7a32d40cad26f487ed7c5e0b8451044a6d7e404e9591bd3919c6daa7488f";
268
285
  }
269
286
  let children;
270
287
  let props;
@@ -285,11 +302,22 @@ const Fullscreen = (t0) => {
285
302
  let t1;
286
303
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
287
304
  t1 = () => {
288
- if (!reference.current) return;
289
- const top = reference.current.getBoundingClientRect().top;
290
- const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
291
- const avail = Math.max(0, Math.floor(viewportHeight - top));
292
- setHeight(avail);
305
+ const element = reference.current;
306
+ if (!element) return;
307
+ const ancestors = getAncestors(element);
308
+ const container = ancestors.at(-1);
309
+ const isRoot = container === document.documentElement;
310
+ const top = element.getBoundingClientRect().top;
311
+ const offsetTop = isRoot ? top + window.scrollY : top - container.getBoundingClientRect().top - container.clientTop + container.scrollTop;
312
+ const containerHeight = isRoot ? window.visualViewport?.height ?? window.innerHeight : container.clientHeight;
313
+ let trailing = px(getComputedStyle(element).marginBottom);
314
+ for (const ancestor of ancestors) {
315
+ const style = getComputedStyle(ancestor);
316
+ trailing = trailing + px(style.paddingBottom);
317
+ if (ancestor === container) break;
318
+ trailing = trailing + (px(style.borderBottomWidth) + px(style.marginBottom));
319
+ }
320
+ setHeight(Math.max(0, Math.floor(containerHeight - offsetTop - trailing)));
293
321
  };
294
322
  $[5] = t1;
295
323
  } else t1 = $[5];
@@ -297,16 +325,17 @@ const Fullscreen = (t0) => {
297
325
  let t2;
298
326
  if ($[6] !== recompute) {
299
327
  t2 = () => {
300
- const element = reference.current;
301
- if (!element) return;
328
+ const element_0 = reference.current;
329
+ if (!element_0) return;
302
330
  recompute();
303
331
  window.addEventListener("resize", recompute);
304
- const ro = new ResizeObserver(recompute);
305
- ro.observe(document.documentElement);
306
- ro.observe(document.body);
307
- ro.observe(element);
332
+ window.visualViewport?.addEventListener("resize", recompute);
333
+ const ro = new ResizeObserver(() => recompute());
334
+ ro.observe(element_0);
335
+ for (const ancestor_0 of getAncestors(element_0)) ro.observe(ancestor_0);
308
336
  return () => {
309
337
  window.removeEventListener("resize", recompute);
338
+ window.visualViewport?.removeEventListener("resize", recompute);
310
339
  ro.disconnect();
311
340
  };
312
341
  };
@@ -361,15 +390,14 @@ const baseStyle = {
361
390
  borderWidth: 2,
362
391
  borderRadius: 2,
363
392
  borderStyle: "dashed",
364
- outline: "none",
365
- transition: "border .24s ease-in-out",
393
+ transition: "border-color .24s ease-in-out",
366
394
  cursor: "pointer"
367
395
  };
368
396
  const Dropzone = (t0) => {
369
- const $ = c(32);
370
- if ($[0] !== "835a1014bc277abe6d9ec1a05ba4c7bf5844ace27aac767fe4a606b16069e907") {
371
- for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
372
- $[0] = "835a1014bc277abe6d9ec1a05ba4c7bf5844ace27aac767fe4a606b16069e907";
397
+ const $ = c(33);
398
+ if ($[0] !== "5f7e412e732333f86e343ff1dbc3882283622c609fd4ce6a961ebef933e25fd9") {
399
+ for (let $i = 0; $i < 33; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
400
+ $[0] = "5f7e412e732333f86e343ff1dbc3882283622c609fd4ce6a961ebef933e25fd9";
373
401
  }
374
402
  let progress;
375
403
  let props;
@@ -392,7 +420,7 @@ const Dropzone = (t0) => {
392
420
  const t2 = theme.vars || theme;
393
421
  let T0;
394
422
  let t3;
395
- if ($[5] !== getRootProps || $[6] !== isDragAccept || $[7] !== isDragReject || $[8] !== isFocused || $[9] !== t1 || $[10] !== t2.palette.text.disabled || $[11] !== theme) {
423
+ if ($[5] !== getRootProps || $[6] !== isDragAccept || $[7] !== isDragReject || $[8] !== isFocused || $[9] !== props.disabled || $[10] !== t1 || $[11] !== t2.palette.text.disabled || $[12] !== theme) {
396
424
  const style = {
397
425
  ...baseStyle,
398
426
  cursor: t1,
@@ -402,64 +430,70 @@ const Dropzone = (t0) => {
402
430
  ...isDragReject ? { borderColor: (theme.vars || theme).palette.error.main } : {}
403
431
  };
404
432
  T0 = Box;
405
- t3 = getRootProps({ style });
433
+ t3 = getRootProps({
434
+ style,
435
+ role: "button",
436
+ "aria-disabled": props.disabled || void 0
437
+ });
406
438
  $[5] = getRootProps;
407
439
  $[6] = isDragAccept;
408
440
  $[7] = isDragReject;
409
441
  $[8] = isFocused;
410
- $[9] = t1;
411
- $[10] = t2.palette.text.disabled;
412
- $[11] = theme;
413
- $[12] = T0;
414
- $[13] = t3;
442
+ $[9] = props.disabled;
443
+ $[10] = t1;
444
+ $[11] = t2.palette.text.disabled;
445
+ $[12] = theme;
446
+ $[13] = T0;
447
+ $[14] = t3;
415
448
  } else {
416
- T0 = $[12];
417
- t3 = $[13];
449
+ T0 = $[13];
450
+ t3 = $[14];
418
451
  }
419
452
  let t4;
420
- if ($[14] !== getInputProps) {
453
+ if ($[15] !== getInputProps) {
421
454
  t4 = getInputProps();
422
- $[14] = getInputProps;
423
- $[15] = t4;
424
- } else t4 = $[15];
455
+ $[15] = getInputProps;
456
+ $[16] = t4;
457
+ } else t4 = $[16];
425
458
  let t5;
426
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
459
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
427
460
  t5 = { display: "none" };
428
- $[16] = t5;
429
- } else t5 = $[16];
461
+ $[17] = t5;
462
+ } else t5 = $[17];
430
463
  let t6;
431
- if ($[17] !== t4) {
464
+ if ($[18] !== t4) {
432
465
  t6 = /* @__PURE__ */ jsx("input", {
433
466
  ...t4,
434
467
  style: t5
435
468
  });
436
- $[17] = t4;
437
- $[18] = t6;
438
- } else t6 = $[18];
469
+ $[18] = t4;
470
+ $[19] = t6;
471
+ } else t6 = $[19];
439
472
  let t7;
440
- if ($[19] !== progress) {
473
+ if ($[20] !== progress) {
441
474
  t7 = progress ? /* @__PURE__ */ jsx(CircularProgress, {
442
475
  size: 24,
443
476
  variant: "determinate",
444
- value: progress
477
+ value: progress,
478
+ "aria-label": "Uploading"
445
479
  }) : /* @__PURE__ */ jsx(CloudUpload, {});
446
- $[19] = progress;
447
- $[20] = t7;
448
- } else t7 = $[20];
480
+ $[20] = progress;
481
+ $[21] = t7;
482
+ } else t7 = $[21];
449
483
  let t8;
450
- if ($[21] !== t) {
484
+ if ($[22] !== t) {
451
485
  t8 = t("Layout.File.DragSomeFilesHereOrClickToSelectThem");
452
- $[21] = t;
453
- $[22] = t8;
454
- } else t8 = $[22];
486
+ $[22] = t;
487
+ $[23] = t8;
488
+ } else t8 = $[23];
455
489
  let t9;
456
- if ($[23] !== t8) {
490
+ if ($[24] !== t8) {
457
491
  t9 = /* @__PURE__ */ jsx(Typography, { children: t8 });
458
- $[23] = t8;
459
- $[24] = t9;
460
- } else t9 = $[24];
492
+ $[24] = t8;
493
+ $[25] = t9;
494
+ } else t9 = $[25];
461
495
  let t10;
462
- if ($[25] !== T0 || $[26] !== sx || $[27] !== t3 || $[28] !== t6 || $[29] !== t7 || $[30] !== t9) {
496
+ if ($[26] !== T0 || $[27] !== sx || $[28] !== t3 || $[29] !== t6 || $[30] !== t7 || $[31] !== t9) {
463
497
  t10 = /* @__PURE__ */ jsxs(T0, {
464
498
  ...t3,
465
499
  sx,
@@ -469,14 +503,14 @@ const Dropzone = (t0) => {
469
503
  t9
470
504
  ]
471
505
  });
472
- $[25] = T0;
473
- $[26] = sx;
474
- $[27] = t3;
475
- $[28] = t6;
476
- $[29] = t7;
477
- $[30] = t9;
478
- $[31] = t10;
479
- } else t10 = $[31];
506
+ $[26] = T0;
507
+ $[27] = sx;
508
+ $[28] = t3;
509
+ $[29] = t6;
510
+ $[30] = t7;
511
+ $[31] = t9;
512
+ $[32] = t10;
513
+ } else t10 = $[32];
480
514
  return t10;
481
515
  };
482
516
  //#endregion
@@ -484,9 +518,9 @@ const Dropzone = (t0) => {
484
518
  const FileContext = createContext(null);
485
519
  const useFile = () => {
486
520
  const $ = c(1);
487
- if ($[0] !== "a9a469a99242723a03ab2ab21b9513f8d7f393e7a397296039721f8243a94fd9") {
521
+ if ($[0] !== "789f01e265d2e58bf61ca53d252b729cbba9746bda4ad35fa3d3560f0590dabc") {
488
522
  for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
489
- $[0] = "a9a469a99242723a03ab2ab21b9513f8d7f393e7a397296039721f8243a94fd9";
523
+ $[0] = "789f01e265d2e58bf61ca53d252b729cbba9746bda4ad35fa3d3560f0590dabc";
490
524
  }
491
525
  const context = useContext(FileContext);
492
526
  if (!context) throw new Error("FileViewer components must be used within FileViewer");
@@ -495,47 +529,38 @@ const useFile = () => {
495
529
  //#endregion
496
530
  //#region src/components/file/fileViewer/common/ActionsMenu.tsx
497
531
  const ActionsMenu = (t0) => {
498
- const $ = c(43);
499
- if ($[0] !== "37413a10a2df1dbf561819b83375455df60d2eb9e9781fbb0853c0e5c2f8a772") {
500
- for (let $i = 0; $i < 43; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
501
- $[0] = "37413a10a2df1dbf561819b83375455df60d2eb9e9781fbb0853c0e5c2f8a772";
532
+ const $ = c(38);
533
+ if ($[0] !== "7ed2ca73a1b83560ce36924119f722bc2853d54808eacf915e739dac0ddf031e") {
534
+ for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
535
+ $[0] = "7ed2ca73a1b83560ce36924119f722bc2853d54808eacf915e739dac0ddf031e";
502
536
  }
503
- const { meta, menu, setMenu } = t0;
537
+ const { meta, anchorEl, onClose } = t0;
504
538
  const { t } = useTranslation();
505
539
  const { fileMetas, onDelete, actions, appName } = useFile();
506
- const { confirm } = useDialogs();
540
+ const { alert, confirm } = useDialogs();
507
541
  let t1;
508
- if ($[1] !== setMenu) {
509
- t1 = () => {
510
- setMenu(null);
511
- };
512
- $[1] = setMenu;
513
- $[2] = t1;
514
- } else t1 = $[2];
515
- const handleMenuClose = t1;
542
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
543
+ t1 = { from: rootRouteId };
544
+ $[1] = t1;
545
+ } else t1 = $[1];
546
+ const queryClient = useMatch(t1).context.queryClient;
516
547
  let t2;
517
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
518
- t2 = { from: rootRouteId };
519
- $[3] = t2;
520
- } else t2 = $[3];
521
- const queryClient = useMatch(t2).context.queryClient;
548
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
549
+ t2 = downloadFileMutationOptions();
550
+ $[2] = t2;
551
+ } else t2 = $[2];
552
+ const { mutate: download, isPending: isDownloading } = useMutation(t2);
522
553
  let t3;
523
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
524
- t3 = downloadFileMutationOptions();
554
+ if ($[3] !== queryClient) {
555
+ t3 = deleteFileMutationOptions({ queryClient });
556
+ $[3] = queryClient;
525
557
  $[4] = t3;
526
558
  } else t3 = $[4];
527
- const { mutate: download, isPending: isDownloading } = useMutation(t3);
559
+ const { mutateAsync: deleteFile, isPending: isDeleting } = useMutation(t3);
528
560
  let t4;
529
- if ($[5] !== queryClient) {
530
- t4 = deleteFileMutationOptions({ queryClient });
531
- $[5] = queryClient;
532
- $[6] = t4;
533
- } else t4 = $[6];
534
- const { mutate: deleteFile, isPending: isDeleting } = useMutation(t4);
535
- let t5;
536
- if ($[7] !== appName || $[8] !== download || $[9] !== handleMenuClose || $[10] !== meta.fileExtension || $[11] !== meta.fileName || $[12] !== meta.id) {
537
- t5 = () => {
538
- handleMenuClose();
561
+ if ($[5] !== appName || $[6] !== download || $[7] !== meta.fileExtension || $[8] !== meta.fileName || $[9] !== meta.id || $[10] !== onClose) {
562
+ t4 = () => {
563
+ onClose();
539
564
  download({
540
565
  id: meta.id,
541
566
  appName,
@@ -543,115 +568,102 @@ const ActionsMenu = (t0) => {
543
568
  fileExtension: meta.fileExtension
544
569
  });
545
570
  };
546
- $[7] = appName;
547
- $[8] = download;
548
- $[9] = handleMenuClose;
549
- $[10] = meta.fileExtension;
550
- $[11] = meta.fileName;
551
- $[12] = meta.id;
552
- $[13] = t5;
553
- } else t5 = $[13];
554
- const handleOnDownload = t5;
555
- let t6;
556
- if ($[14] !== appName || $[15] !== confirm || $[16] !== deleteFile || $[17] !== fileMetas || $[18] !== handleMenuClose || $[19] !== meta || $[20] !== onDelete || $[21] !== t) {
557
- t6 = async () => {
558
- if (!await confirm(t("Layout.File.AreYouSureYouWantToDelete", { name: meta.fileName }))) return;
559
- deleteFile({
560
- id: meta.id,
561
- appName
562
- });
563
- handleMenuClose();
564
- if (onDelete) {
565
- const remainingFileMetas = fileMetas.filter((m) => m.id !== meta.id);
566
- onDelete({
567
- remainingFileMetas,
568
- deletedFileMeta: meta
571
+ $[5] = appName;
572
+ $[6] = download;
573
+ $[7] = meta.fileExtension;
574
+ $[8] = meta.fileName;
575
+ $[9] = meta.id;
576
+ $[10] = onClose;
577
+ $[11] = t4;
578
+ } else t4 = $[11];
579
+ const handleOnDownload = t4;
580
+ let t5;
581
+ if ($[12] !== alert || $[13] !== appName || $[14] !== confirm || $[15] !== deleteFile || $[16] !== fileMetas || $[17] !== meta || $[18] !== onClose || $[19] !== onDelete || $[20] !== t) {
582
+ t5 = async () => {
583
+ onClose();
584
+ if (!await confirm(t("Layout.File.AreYouSureYouWantToDelete", { name: meta.fileName }), {
585
+ title: t("Layout.File.Delete"),
586
+ confirmText: t("Layout.File.Delete")
587
+ })) return;
588
+ try {
589
+ await deleteFile({
590
+ id: meta.id,
591
+ appName
569
592
  });
593
+ } catch (t6) {
594
+ const error = t6;
595
+ await alert(error instanceof Error ? error.message : String(error));
596
+ return;
570
597
  }
598
+ onDelete?.({
599
+ remainingFileMetas: fileMetas.filter((m) => m.id !== meta.id),
600
+ deletedFileMeta: meta
601
+ });
571
602
  };
572
- $[14] = appName;
573
- $[15] = confirm;
574
- $[16] = deleteFile;
575
- $[17] = fileMetas;
576
- $[18] = handleMenuClose;
577
- $[19] = meta;
578
- $[20] = onDelete;
579
- $[21] = t;
580
- $[22] = t6;
581
- } else t6 = $[22];
582
- const handleOnDelete = t6;
583
- const t7 = menu !== null;
584
- let t8;
585
- if ($[23] !== menu) {
586
- t8 = menu === null ? void 0 : {
587
- top: menu.mouseY,
588
- left: menu.mouseX
589
- };
590
- $[23] = menu;
591
- $[24] = t8;
592
- } else t8 = $[24];
593
- let t9;
594
- if ($[25] !== actions?.download || $[26] !== handleOnDownload || $[27] !== isDownloading || $[28] !== t) {
595
- t9 = actions?.download !== false && /* @__PURE__ */ jsxs(ListItemButton, {
603
+ $[12] = alert;
604
+ $[13] = appName;
605
+ $[14] = confirm;
606
+ $[15] = deleteFile;
607
+ $[16] = fileMetas;
608
+ $[17] = meta;
609
+ $[18] = onClose;
610
+ $[19] = onDelete;
611
+ $[20] = t;
612
+ $[21] = t5;
613
+ } else t5 = $[21];
614
+ const handleOnDelete = t5;
615
+ const t6 = !!anchorEl;
616
+ let t7;
617
+ if ($[22] !== actions?.download || $[23] !== handleOnDownload || $[24] !== isDownloading || $[25] !== t) {
618
+ t7 = actions?.download !== false && /* @__PURE__ */ jsxs(MenuItem, {
596
619
  onClick: handleOnDownload,
597
620
  disabled: isDownloading,
598
621
  children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(FileDownload, {}) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.File.Download") })]
599
622
  });
600
- $[25] = actions?.download;
601
- $[26] = handleOnDownload;
602
- $[27] = isDownloading;
603
- $[28] = t;
604
- $[29] = t9;
605
- } else t9 = $[29];
606
- let t10;
607
- if ($[30] !== actions?.delete || $[31] !== handleOnDelete || $[32] !== isDeleting || $[33] !== t) {
608
- t10 = actions?.delete !== false && /* @__PURE__ */ jsxs(ListItemButton, {
623
+ $[22] = actions?.download;
624
+ $[23] = handleOnDownload;
625
+ $[24] = isDownloading;
626
+ $[25] = t;
627
+ $[26] = t7;
628
+ } else t7 = $[26];
629
+ let t8;
630
+ if ($[27] !== actions?.delete || $[28] !== handleOnDelete || $[29] !== isDeleting || $[30] !== t) {
631
+ t8 = actions?.delete !== false && /* @__PURE__ */ jsxs(MenuItem, {
609
632
  onClick: handleOnDelete,
610
633
  disabled: isDeleting,
611
634
  children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(Delete, {}) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.File.Delete") })]
612
635
  });
613
- $[30] = actions?.delete;
614
- $[31] = handleOnDelete;
615
- $[32] = isDeleting;
616
- $[33] = t;
617
- $[34] = t10;
618
- } else t10 = $[34];
619
- let t11;
620
- if ($[35] !== t10 || $[36] !== t9) {
621
- t11 = /* @__PURE__ */ jsxs(List, {
622
- disablePadding: true,
623
- children: [t9, t10]
624
- });
625
- $[35] = t10;
626
- $[36] = t9;
627
- $[37] = t11;
628
- } else t11 = $[37];
629
- let t12;
630
- if ($[38] !== handleMenuClose || $[39] !== t11 || $[40] !== t7 || $[41] !== t8) {
631
- t12 = /* @__PURE__ */ jsx(Menu, {
632
- open: t7,
633
- onClose: handleMenuClose,
634
- anchorReference: "anchorPosition",
635
- variant: "menu",
636
- anchorPosition: t8,
637
- children: t11
636
+ $[27] = actions?.delete;
637
+ $[28] = handleOnDelete;
638
+ $[29] = isDeleting;
639
+ $[30] = t;
640
+ $[31] = t8;
641
+ } else t8 = $[31];
642
+ let t9;
643
+ if ($[32] !== anchorEl || $[33] !== onClose || $[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
644
+ t9 = /* @__PURE__ */ jsxs(Menu, {
645
+ anchorEl,
646
+ open: t6,
647
+ onClose,
648
+ children: [t7, t8]
638
649
  });
639
- $[38] = handleMenuClose;
640
- $[39] = t11;
641
- $[40] = t7;
642
- $[41] = t8;
643
- $[42] = t12;
644
- } else t12 = $[42];
645
- return t12;
650
+ $[32] = anchorEl;
651
+ $[33] = onClose;
652
+ $[34] = t6;
653
+ $[35] = t7;
654
+ $[36] = t8;
655
+ $[37] = t9;
656
+ } else t9 = $[37];
657
+ return t9;
646
658
  };
647
659
  //#endregion
648
660
  //#region src/components/file/fileViewer/FileViewerGrid.tsx
649
661
  const IMAGE_SIZE = 150;
650
662
  const FileViewerGrid = (t0) => {
651
663
  const $ = c(13);
652
- if ($[0] !== "fb41b3b0b995b83bc7531222ea82e43374e75765dca0bbfabbc703db4b87aac4") {
664
+ if ($[0] !== "0b6106e2d976834ad6da1be7ac64269b20131a7e8bed012e78cb98b5ae12e94c") {
653
665
  for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
654
- $[0] = "fb41b3b0b995b83bc7531222ea82e43374e75765dca0bbfabbc703db4b87aac4";
666
+ $[0] = "0b6106e2d976834ad6da1be7ac64269b20131a7e8bed012e78cb98b5ae12e94c";
655
667
  }
656
668
  const { sx, size, itemBar } = t0;
657
669
  const { fileMetas } = useFile();
@@ -699,14 +711,16 @@ const FileViewerGrid = (t0) => {
699
711
  };
700
712
  const GridFileViewerItem = ({ meta, size, itemBar }) => {
701
713
  const { setImageId, actions, appName } = useFile();
702
- const [showItemBar, setShowItemBar] = useState(itemBar === "always");
703
- const [menu, setMenu] = useState(null);
714
+ const [hovered, setHovered] = useState(false);
715
+ const [focused, setFocused] = useState(false);
716
+ const [menuAnchor, setMenuAnchor] = useState(null);
704
717
  const { ref, inView } = useInView();
705
718
  const queryClient = useQueryClient();
706
719
  const target = useRef(null);
707
- useEffect(() => {
708
- setShowItemBar(itemBar === "always");
709
- }, [itemBar]);
720
+ const side = size ?? IMAGE_SIZE;
721
+ const fileName = `${meta.fileName}.${meta.fileExtension}`;
722
+ const hasActions = actions?.download !== false || actions.delete !== false;
723
+ const showItemBar = itemBar === "always" || itemBar !== "hidden" && (hovered || focused || !!menuAnchor);
710
724
  const { data: source, isPending } = useQuery({
711
725
  ...fileThumbnailQueryOptions({
712
726
  id: meta.id,
@@ -714,17 +728,12 @@ const GridFileViewerItem = ({ meta, size, itemBar }) => {
714
728
  }),
715
729
  enabled: inView
716
730
  });
717
- const handleOnMouseEnter = () => setShowItemBar(true);
718
- const handleOnMouseLeave = () => itemBar !== "always" && setShowItemBar(false);
719
- const openMenu = (event) => {
720
- setMenu(menu === null ? {
721
- mouseX: event.clientX,
722
- mouseY: event.clientY
723
- } : null);
724
- setTimeout(() => setShowItemBar(true));
725
- };
726
731
  const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));
727
732
  const { mutate: download } = useMutation(downloadFileMutationOptions());
733
+ const prefetch = () => queryClient.prefetchQuery(fileQueryOptions({
734
+ id: meta.id,
735
+ appName
736
+ }));
728
737
  const onClick = () => {
729
738
  switch (meta.mediaType) {
730
739
  case "image": return setImageId(meta.id);
@@ -745,63 +754,77 @@ const GridFileViewerItem = ({ meta, size, itemBar }) => {
745
754
  };
746
755
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ImageListItem, {
747
756
  sx: {
748
- width: size ?? IMAGE_SIZE,
749
- height: size ?? IMAGE_SIZE
757
+ width: side,
758
+ height: side
759
+ },
760
+ onMouseEnter: () => setHovered(true),
761
+ onMouseLeave: () => setHovered(false),
762
+ onFocus: () => setFocused(true),
763
+ onBlur: (event) => {
764
+ if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
750
765
  },
751
- onMouseEnter: handleOnMouseEnter,
752
- onMouseLeave: handleOnMouseLeave,
753
766
  ref,
754
767
  children: [isPending ? /* @__PURE__ */ jsx(Skeleton, {
755
768
  variant: "rectangular",
756
- width: size ?? IMAGE_SIZE,
757
- height: size ?? IMAGE_SIZE
758
- }) : /* @__PURE__ */ jsx(Box, {
759
- component: "img",
760
- src: source,
761
- loading: "lazy",
762
- alt: "thumbnail-" + meta.id,
769
+ width: side,
770
+ height: side
771
+ }) : /* @__PURE__ */ jsx(ButtonBase, {
763
772
  onClick,
764
- onMouseEnter: () => queryClient.prefetchQuery(fileQueryOptions({
765
- id: meta.id,
766
- appName
767
- })),
773
+ onMouseEnter: prefetch,
774
+ onFocus: prefetch,
775
+ "aria-label": `Open ${fileName}`,
768
776
  sx: {
769
- cursor: "pointer",
770
- objectFit: "contain",
771
- width: size ?? IMAGE_SIZE,
772
- height: size ?? IMAGE_SIZE
773
- }
774
- }), itemBar !== "hidden" && showItemBar && /* @__PURE__ */ jsx(ImageListItemBar, {
777
+ width: side,
778
+ height: side,
779
+ "&.Mui-focusVisible": {
780
+ outline: "2px solid",
781
+ outlineColor: "primary.main",
782
+ outlineOffset: -2
783
+ }
784
+ },
785
+ children: /* @__PURE__ */ jsx(Box, {
786
+ component: "img",
787
+ src: source,
788
+ loading: "lazy",
789
+ alt: "",
790
+ sx: {
791
+ objectFit: "contain",
792
+ width: side,
793
+ height: side
794
+ }
795
+ })
796
+ }), showItemBar && /* @__PURE__ */ jsx(ImageListItemBar, {
775
797
  title: /* @__PURE__ */ jsx(Tooltip, {
776
- title: meta.fileName,
798
+ title: fileName,
777
799
  children: /* @__PURE__ */ jsx(Box, { children: meta.fileName })
778
800
  }),
779
- actionIcon: (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(IconButton, {
801
+ actionIcon: hasActions && /* @__PURE__ */ jsx(IconButton, {
780
802
  sx: { color: grey[100] },
781
- onClick: openMenu,
782
- "aria-label": "File actions",
803
+ onClick: (event_0) => setMenuAnchor(event_0.currentTarget),
804
+ "aria-label": `Actions for ${fileName}`,
805
+ "aria-haspopup": "menu",
783
806
  children: /* @__PURE__ */ jsx(MoreVert, {})
784
807
  })
785
808
  })]
786
- }), (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(ActionsMenu, {
809
+ }), hasActions && /* @__PURE__ */ jsx(ActionsMenu, {
787
810
  meta,
788
- menu,
789
- setMenu
811
+ anchorEl: menuAnchor,
812
+ onClose: () => setMenuAnchor(null)
790
813
  })] });
791
814
  };
792
815
  //#endregion
793
816
  //#region src/components/file/fileViewer/FileViewerList.tsx
794
817
  const FileViewerList = (t0) => {
795
818
  const $ = c(6);
796
- if ($[0] !== "90821c9c06bc31e3067959087f22fa79fc3b392b2e1718015a5455d608dce1c7") {
819
+ if ($[0] !== "def12bfee125db96c0e25478a726cf153aa928252368ec27de2bcba8f364adae") {
797
820
  for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
798
- $[0] = "90821c9c06bc31e3067959087f22fa79fc3b392b2e1718015a5455d608dce1c7";
821
+ $[0] = "def12bfee125db96c0e25478a726cf153aa928252368ec27de2bcba8f364adae";
799
822
  }
800
823
  const { sx } = t0;
801
824
  const { fileMetas } = useFile();
802
825
  let t1;
803
826
  if ($[1] !== fileMetas) {
804
- t1 = fileMetas.map(_temp);
827
+ t1 = fileMetas.map(_temp$1);
805
828
  $[1] = fileMetas;
806
829
  $[2] = t1;
807
830
  } else t1 = $[2];
@@ -820,16 +843,11 @@ const FileViewerList = (t0) => {
820
843
  };
821
844
  const ListFileViewerItem = ({ meta }) => {
822
845
  const { setImageId, actions, appName } = useFile();
823
- const [menu, setMenu] = useState(null);
846
+ const [menuAnchor, setMenuAnchor] = useState(null);
824
847
  const queryClient = useQueryClient();
825
848
  const target = useRef(null);
826
- const openMenu = (event) => {
827
- event.stopPropagation();
828
- setMenu(menu === null ? {
829
- mouseX: event.clientX,
830
- mouseY: event.clientY
831
- } : null);
832
- };
849
+ const fileName = `${meta.fileName}.${meta.fileExtension}`;
850
+ const hasActions = actions?.download !== false || actions.delete !== false;
833
851
  const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));
834
852
  const { mutate: download } = useMutation(downloadFileMutationOptions());
835
853
  const onClick = () => {
@@ -857,80 +875,173 @@ const ListFileViewerItem = ({ meta }) => {
857
875
  default: return /* @__PURE__ */ jsx(AttachFile, {});
858
876
  }
859
877
  };
860
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ListItemButton, {
861
- onClick,
862
- onMouseEnter: () => queryClient.prefetchQuery(fileQueryOptions({
863
- id: meta.id,
864
- appName
865
- })),
866
- children: [
867
- /* @__PURE__ */ jsx(ListItemIcon, { children: icon() }),
868
- /* @__PURE__ */ jsx(ListItemText, { primary: `${meta.fileName}.${meta.fileExtension}` }),
869
- (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(IconButton, {
870
- edge: "end",
871
- onClick: openMenu,
872
- "aria-label": "File actions",
873
- children: /* @__PURE__ */ jsx(MoreVert, {})
874
- })
875
- ]
876
- }, meta.id), (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(ActionsMenu, {
878
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ListItem, {
879
+ disablePadding: true,
880
+ secondaryAction: hasActions && /* @__PURE__ */ jsx(IconButton, {
881
+ edge: "end",
882
+ onClick: (event) => setMenuAnchor(event.currentTarget),
883
+ "aria-label": `Actions for ${fileName}`,
884
+ "aria-haspopup": "menu",
885
+ children: /* @__PURE__ */ jsx(MoreVert, {})
886
+ }),
887
+ children: /* @__PURE__ */ jsxs(ListItemButton, {
888
+ onClick,
889
+ onMouseEnter: () => queryClient.prefetchQuery(fileQueryOptions({
890
+ id: meta.id,
891
+ appName
892
+ })),
893
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: icon() }), /* @__PURE__ */ jsx(ListItemText, { primary: fileName })]
894
+ })
895
+ }), hasActions && /* @__PURE__ */ jsx(ActionsMenu, {
877
896
  meta,
878
- menu,
879
- setMenu
897
+ anchorEl: menuAnchor,
898
+ onClose: () => setMenuAnchor(null)
880
899
  })] });
881
900
  };
882
- function _temp(fileMeta) {
901
+ function _temp$1(fileMeta) {
883
902
  return /* @__PURE__ */ jsx(ListFileViewerItem, { meta: fileMeta }, fileMeta.id);
884
903
  }
885
904
  //#endregion
886
905
  //#region src/components/file/fileViewer/ImageViewer.tsx
887
- const ImageViewer = ({ metaId }) => {
906
+ const ImageViewer = (t0) => {
907
+ const $ = c(56);
908
+ if ($[0] !== "c362b5d42dedaecf837e96525daab6341b34e31726fb1413e37d4a5eb8122071") {
909
+ for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
910
+ $[0] = "c362b5d42dedaecf837e96525daab6341b34e31726fb1413e37d4a5eb8122071";
911
+ }
912
+ const { metaId } = t0;
888
913
  const { fileMetas, setImageId, appName } = useFile();
889
- const meta = fileMetas.find((m) => m.id === metaId);
890
- const { data: source, isPending } = useQuery({
891
- ...fileQueryOptions({
914
+ let meta;
915
+ let next;
916
+ let previous;
917
+ let t1;
918
+ let t2;
919
+ if ($[1] !== appName || $[2] !== fileMetas || $[3] !== metaId) {
920
+ let t3;
921
+ if ($[9] !== metaId) {
922
+ t3 = (m) => m.id === metaId;
923
+ $[9] = metaId;
924
+ $[10] = t3;
925
+ } else t3 = $[10];
926
+ meta = fileMetas.find(t3);
927
+ let images;
928
+ let t4;
929
+ if ($[11] !== fileMetas || $[12] !== metaId) {
930
+ images = fileMetas.filter(_temp);
931
+ let t5;
932
+ if ($[15] !== metaId) {
933
+ t5 = (m_1) => m_1.id === metaId;
934
+ $[15] = metaId;
935
+ $[16] = t5;
936
+ } else t5 = $[16];
937
+ t4 = images.findIndex(t5);
938
+ $[11] = fileMetas;
939
+ $[12] = metaId;
940
+ $[13] = images;
941
+ $[14] = t4;
942
+ } else {
943
+ images = $[13];
944
+ t4 = $[14];
945
+ }
946
+ const index = t4;
947
+ previous = index > 0 ? images[index - 1] : void 0;
948
+ next = index >= 0 && index < images.length - 1 ? images[index + 1] : void 0;
949
+ t2 = useQuery;
950
+ t1 = fileQueryOptions({
892
951
  id: meta?.id ?? "",
893
952
  appName
894
- }),
895
- enabled: !!meta
896
- });
897
- useEffect(() => {
898
- if (metaId) globalThis.addEventListener("keydown", handleOnKeydown);
899
- return () => {
900
- globalThis.removeEventListener("keydown", handleOnKeydown);
953
+ });
954
+ $[1] = appName;
955
+ $[2] = fileMetas;
956
+ $[3] = metaId;
957
+ $[4] = meta;
958
+ $[5] = next;
959
+ $[6] = previous;
960
+ $[7] = t1;
961
+ $[8] = t2;
962
+ } else {
963
+ meta = $[4];
964
+ next = $[5];
965
+ previous = $[6];
966
+ t1 = $[7];
967
+ t2 = $[8];
968
+ }
969
+ const t3 = !!meta;
970
+ let t4;
971
+ if ($[17] !== t1 || $[18] !== t3) {
972
+ t4 = {
973
+ ...t1,
974
+ enabled: t3
901
975
  };
902
- }, [metaId]);
903
- const handleOnKeydown = (event) => {
904
- const images = fileMetas.filter((m_0) => m_0.mediaType === "image");
905
- const imageIndex = images.findIndex((m_1) => m_1.id === metaId);
906
- switch (event.key) {
907
- case "ArrowLeft": return handleOnArrowLeft(images, imageIndex);
908
- case "ArrowRight": return handleOnArrowRight(images, imageIndex);
909
- case "Backspace":
910
- case "Escape":
911
- event.preventDefault();
912
- return onClose();
913
- }
914
- };
915
- const handleOnArrowLeft = (images_0, index) => {
916
- if (index > 0) {
917
- const previousFile = images_0[index - 1];
918
- setImageId(previousFile.id);
919
- }
920
- };
921
- const handleOnArrowRight = (images_1, index_0) => {
922
- if (index_0 < images_1.length - 1) {
923
- const nextFile = images_1[index_0 + 1];
924
- setImageId(nextFile.id);
925
- }
926
- };
927
- const onClose = () => setImageId("");
976
+ $[17] = t1;
977
+ $[18] = t3;
978
+ $[19] = t4;
979
+ } else t4 = $[19];
980
+ const { data: source, isPending } = t2(t4);
981
+ let t5;
982
+ if ($[20] !== setImageId) {
983
+ t5 = () => setImageId("");
984
+ $[20] = setImageId;
985
+ $[21] = t5;
986
+ } else t5 = $[21];
987
+ const onClose = t5;
988
+ let t6;
989
+ if ($[22] !== metaId || $[23] !== next || $[24] !== onClose || $[25] !== previous || $[26] !== setImageId) {
990
+ t6 = () => {
991
+ if (!metaId) return;
992
+ const handleOnKeydown = (event) => {
993
+ switch (event.key) {
994
+ case "ArrowLeft": return previous && setImageId(previous.id);
995
+ case "ArrowRight": return next && setImageId(next.id);
996
+ case "Backspace":
997
+ case "Escape":
998
+ event.preventDefault();
999
+ return onClose();
1000
+ }
1001
+ };
1002
+ globalThis.addEventListener("keydown", handleOnKeydown);
1003
+ return () => globalThis.removeEventListener("keydown", handleOnKeydown);
1004
+ };
1005
+ $[22] = metaId;
1006
+ $[23] = next;
1007
+ $[24] = onClose;
1008
+ $[25] = previous;
1009
+ $[26] = setImageId;
1010
+ $[27] = t6;
1011
+ } else t6 = $[27];
1012
+ let t7;
1013
+ if ($[28] !== metaId || $[29] !== next || $[30] !== previous) {
1014
+ t7 = [
1015
+ metaId,
1016
+ previous,
1017
+ next
1018
+ ];
1019
+ $[28] = metaId;
1020
+ $[29] = next;
1021
+ $[30] = previous;
1022
+ $[31] = t7;
1023
+ } else t7 = $[31];
1024
+ useEffect(t6, t7);
928
1025
  if (!meta) return null;
929
- return /* @__PURE__ */ jsxs(Dialog, {
930
- open: true,
931
- onClose,
932
- maxWidth: "xl",
933
- children: [isPending ? /* @__PURE__ */ jsx(Skeleton, {
1026
+ let t8;
1027
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
1028
+ t8 = {
1029
+ position: "fixed",
1030
+ top: "50%",
1031
+ transform: "translateY(-50%)"
1032
+ };
1033
+ $[32] = t8;
1034
+ } else t8 = $[32];
1035
+ const navSx = t8;
1036
+ let t9;
1037
+ if ($[33] !== meta.fileName) {
1038
+ t9 = { paper: { "aria-label": meta.fileName } };
1039
+ $[33] = meta.fileName;
1040
+ $[34] = t9;
1041
+ } else t9 = $[34];
1042
+ let t10;
1043
+ if ($[35] !== isPending || $[36] !== meta.fileName || $[37] !== source) {
1044
+ t10 = isPending ? /* @__PURE__ */ jsx(Skeleton, {
934
1045
  variant: "rectangular",
935
1046
  sx: {
936
1047
  width: {
@@ -953,26 +1064,105 @@ const ImageViewer = ({ metaId }) => {
953
1064
  sm: "calc(100vh - 64px)"
954
1065
  }
955
1066
  }
956
- }), /* @__PURE__ */ jsx(Fab, {
1067
+ });
1068
+ $[35] = isPending;
1069
+ $[36] = meta.fileName;
1070
+ $[37] = source;
1071
+ $[38] = t10;
1072
+ } else t10 = $[38];
1073
+ let t11;
1074
+ if ($[39] !== previous || $[40] !== setImageId) {
1075
+ t11 = previous && /* @__PURE__ */ jsx(Fab, {
957
1076
  size: "medium",
958
- onClick: onClose,
959
- "aria-label": "Close",
1077
+ onClick: () => setImageId(previous.id),
1078
+ "aria-label": "Previous",
1079
+ sx: {
1080
+ ...navSx,
1081
+ left: 8
1082
+ },
1083
+ children: /* @__PURE__ */ jsx(ChevronLeft, {})
1084
+ });
1085
+ $[39] = previous;
1086
+ $[40] = setImageId;
1087
+ $[41] = t11;
1088
+ } else t11 = $[41];
1089
+ let t12;
1090
+ if ($[42] !== next || $[43] !== setImageId) {
1091
+ t12 = next && /* @__PURE__ */ jsx(Fab, {
1092
+ size: "medium",
1093
+ onClick: () => setImageId(next.id),
1094
+ "aria-label": "Next",
960
1095
  sx: {
961
- position: "fixed",
962
- top: 8,
1096
+ ...navSx,
963
1097
  right: 8
964
1098
  },
965
- children: /* @__PURE__ */ jsx(Close, {})
966
- })]
967
- });
1099
+ children: /* @__PURE__ */ jsx(ChevronRight, {})
1100
+ });
1101
+ $[42] = next;
1102
+ $[43] = setImageId;
1103
+ $[44] = t12;
1104
+ } else t12 = $[44];
1105
+ let t13;
1106
+ let t14;
1107
+ if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
1108
+ t13 = {
1109
+ position: "fixed",
1110
+ top: 8,
1111
+ right: 8
1112
+ };
1113
+ t14 = /* @__PURE__ */ jsx(Close, {});
1114
+ $[45] = t13;
1115
+ $[46] = t14;
1116
+ } else {
1117
+ t13 = $[45];
1118
+ t14 = $[46];
1119
+ }
1120
+ let t15;
1121
+ if ($[47] !== onClose) {
1122
+ t15 = /* @__PURE__ */ jsx(Fab, {
1123
+ size: "medium",
1124
+ onClick: onClose,
1125
+ "aria-label": "Close",
1126
+ sx: t13,
1127
+ children: t14
1128
+ });
1129
+ $[47] = onClose;
1130
+ $[48] = t15;
1131
+ } else t15 = $[48];
1132
+ let t16;
1133
+ if ($[49] !== onClose || $[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t15 || $[54] !== t9) {
1134
+ t16 = /* @__PURE__ */ jsxs(Dialog, {
1135
+ open: true,
1136
+ onClose,
1137
+ maxWidth: "xl",
1138
+ slotProps: t9,
1139
+ children: [
1140
+ t10,
1141
+ t11,
1142
+ t12,
1143
+ t15
1144
+ ]
1145
+ });
1146
+ $[49] = onClose;
1147
+ $[50] = t10;
1148
+ $[51] = t11;
1149
+ $[52] = t12;
1150
+ $[53] = t15;
1151
+ $[54] = t9;
1152
+ $[55] = t16;
1153
+ } else t16 = $[55];
1154
+ return t16;
968
1155
  };
1156
+ function _temp(m_0) {
1157
+ return m_0.mediaType === "image";
1158
+ }
969
1159
  //#endregion
970
1160
  //#region src/components/file/FileViewer.tsx
971
1161
  const FileViewer = (t0) => {
972
1162
  const $ = c(22);
973
- if ($[0] !== "f20716e955e976c65e4217e568b647786c1c8599751fff5b227781489170527e") {
1163
+ if ($[0] !== "e56cccf59021ad4f268b0fa9c3b1b47aaffd2cf82021d791cbb7aecbc2510344") {
974
1164
  for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
975
- $[0] = "f20716e955e976c65e4217e568b647786c1c8599751fff5b227781489170527e";
1165
+ $[0] = "e56cccf59021ad4f268b0fa9c3b1b47aaffd2cf82021d791cbb7aecbc2510344";
976
1166
  }
977
1167
  const { appName, subId, onDelete, actions, children } = t0;
978
1168
  let t1;
@@ -1053,9 +1243,9 @@ const FileViewer = (t0) => {
1053
1243
  //#region src/components/router/RouterButton.tsx
1054
1244
  const Component$3 = React.forwardRef(function ButtonComponent(props, reference) {
1055
1245
  const $ = c(4);
1056
- if ($[0] !== "ac6204c9fa419bc8efad3ebea0df725f19f2cc476a09c695e535caec26527133") {
1246
+ if ($[0] !== "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e") {
1057
1247
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1058
- $[0] = "ac6204c9fa419bc8efad3ebea0df725f19f2cc476a09c695e535caec26527133";
1248
+ $[0] = "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e";
1059
1249
  }
1060
1250
  let t0;
1061
1251
  if ($[1] !== props || $[2] !== reference) {
@@ -1073,9 +1263,9 @@ const Component$3 = React.forwardRef(function ButtonComponent(props, reference)
1073
1263
  const CreatedComponent$3 = createLink(Component$3);
1074
1264
  const RouterButton = (props) => {
1075
1265
  const $ = c(3);
1076
- if ($[0] !== "ac6204c9fa419bc8efad3ebea0df725f19f2cc476a09c695e535caec26527133") {
1266
+ if ($[0] !== "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e") {
1077
1267
  for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1078
- $[0] = "ac6204c9fa419bc8efad3ebea0df725f19f2cc476a09c695e535caec26527133";
1268
+ $[0] = "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e";
1079
1269
  }
1080
1270
  let t0;
1081
1271
  if ($[1] !== props) {
@@ -1089,9 +1279,9 @@ const RouterButton = (props) => {
1089
1279
  //#region src/components/router/RouterFab.tsx
1090
1280
  const Component$2 = React.forwardRef(function FabComponent(props, reference) {
1091
1281
  const $ = c(4);
1092
- if ($[0] !== "ecf406c2f1df75bd8d4f8cc1e2a0841119cda75e807b28c7c03400a2d927c16b") {
1282
+ if ($[0] !== "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3") {
1093
1283
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1094
- $[0] = "ecf406c2f1df75bd8d4f8cc1e2a0841119cda75e807b28c7c03400a2d927c16b";
1284
+ $[0] = "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3";
1095
1285
  }
1096
1286
  let t0;
1097
1287
  if ($[1] !== props || $[2] !== reference) {
@@ -1109,9 +1299,9 @@ const Component$2 = React.forwardRef(function FabComponent(props, reference) {
1109
1299
  const CreatedComponent$2 = createLink(Component$2);
1110
1300
  const RouterFab = (props) => {
1111
1301
  const $ = c(3);
1112
- if ($[0] !== "ecf406c2f1df75bd8d4f8cc1e2a0841119cda75e807b28c7c03400a2d927c16b") {
1302
+ if ($[0] !== "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3") {
1113
1303
  for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1114
- $[0] = "ecf406c2f1df75bd8d4f8cc1e2a0841119cda75e807b28c7c03400a2d927c16b";
1304
+ $[0] = "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3";
1115
1305
  }
1116
1306
  let t0;
1117
1307
  if ($[1] !== props) {
@@ -1125,9 +1315,9 @@ const RouterFab = (props) => {
1125
1315
  //#region src/components/router/RouterLink.tsx
1126
1316
  const Component$1 = React.forwardRef(function LinkComponent(props, reference) {
1127
1317
  const $ = c(4);
1128
- if ($[0] !== "b12e87e18a050ab0e29a4efcc3bd2a9fa6915db983e56ea2dc68853a7dc4b979") {
1318
+ if ($[0] !== "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d") {
1129
1319
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1130
- $[0] = "b12e87e18a050ab0e29a4efcc3bd2a9fa6915db983e56ea2dc68853a7dc4b979";
1320
+ $[0] = "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d";
1131
1321
  }
1132
1322
  let t0;
1133
1323
  if ($[1] !== props || $[2] !== reference) {
@@ -1144,9 +1334,9 @@ const Component$1 = React.forwardRef(function LinkComponent(props, reference) {
1144
1334
  const CreatedComponent$1 = createLink(Component$1);
1145
1335
  const RouterLink = (props) => {
1146
1336
  const $ = c(3);
1147
- if ($[0] !== "b12e87e18a050ab0e29a4efcc3bd2a9fa6915db983e56ea2dc68853a7dc4b979") {
1337
+ if ($[0] !== "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d") {
1148
1338
  for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1149
- $[0] = "b12e87e18a050ab0e29a4efcc3bd2a9fa6915db983e56ea2dc68853a7dc4b979";
1339
+ $[0] = "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d";
1150
1340
  }
1151
1341
  let t0;
1152
1342
  if ($[1] !== props) {
@@ -1160,9 +1350,9 @@ const RouterLink = (props) => {
1160
1350
  //#region src/components/router/RouterTab.tsx
1161
1351
  const Component = React.forwardRef(function TabComponent(props, reference) {
1162
1352
  const $ = c(4);
1163
- if ($[0] !== "219e07108be3e229bc6eb53840beb65505cbaaf46f02d872937e7895165a73de") {
1353
+ if ($[0] !== "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816") {
1164
1354
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1165
- $[0] = "219e07108be3e229bc6eb53840beb65505cbaaf46f02d872937e7895165a73de";
1355
+ $[0] = "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816";
1166
1356
  }
1167
1357
  let t0;
1168
1358
  if ($[1] !== props || $[2] !== reference) {
@@ -1180,9 +1370,9 @@ const Component = React.forwardRef(function TabComponent(props, reference) {
1180
1370
  const CreatedComponent = createLink(Component);
1181
1371
  const RouterTab = (props) => {
1182
1372
  const $ = c(3);
1183
- if ($[0] !== "219e07108be3e229bc6eb53840beb65505cbaaf46f02d872937e7895165a73de") {
1373
+ if ($[0] !== "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816") {
1184
1374
  for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1185
- $[0] = "219e07108be3e229bc6eb53840beb65505cbaaf46f02d872937e7895165a73de";
1375
+ $[0] = "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816";
1186
1376
  }
1187
1377
  let t0;
1188
1378
  if ($[1] !== props) {
@@ -1196,9 +1386,9 @@ const RouterTab = (props) => {
1196
1386
  //#region src/components/router/RouterNotFound.tsx
1197
1387
  function RouterNotFound() {
1198
1388
  const $ = c(9);
1199
- if ($[0] !== "8a932f32be41de20bb279988c19a99e19e47742df0f90842afbafb2f61f78e2b") {
1389
+ if ($[0] !== "b85bee0f4f29e1fb858e96e13dc2fcbb04a6bbd08c5b88b6d4df66a8869ddb03") {
1200
1390
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1201
- $[0] = "8a932f32be41de20bb279988c19a99e19e47742df0f90842afbafb2f61f78e2b";
1391
+ $[0] = "b85bee0f4f29e1fb858e96e13dc2fcbb04a6bbd08c5b88b6d4df66a8869ddb03";
1202
1392
  }
1203
1393
  const { t } = useTranslation();
1204
1394
  let t0;
@@ -1215,6 +1405,7 @@ function RouterNotFound() {
1215
1405
  t1 = {
1216
1406
  display: "flex",
1217
1407
  alignItems: "center",
1408
+ m: 0,
1218
1409
  mb: 4
1219
1410
  };
1220
1411
  $[2] = t1;
@@ -1235,6 +1426,8 @@ function RouterNotFound() {
1235
1426
  let t3;
1236
1427
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1237
1428
  t3 = /* @__PURE__ */ jsx(Divider, {
1429
+ component: "span",
1430
+ role: "presentation",
1238
1431
  orientation: "vertical",
1239
1432
  flexItem: true,
1240
1433
  sx: { mx: 3 }
@@ -1252,6 +1445,7 @@ function RouterNotFound() {
1252
1445
  t5 = /* @__PURE__ */ jsx(Fullscreen, {
1253
1446
  sx: t0,
1254
1447
  children: /* @__PURE__ */ jsxs(Box, {
1448
+ component: "h1",
1255
1449
  sx: t1,
1256
1450
  children: [
1257
1451
  t2,
@@ -1273,9 +1467,9 @@ function RouterNotFound() {
1273
1467
  //#region src/components/router/RouterError.tsx
1274
1468
  const RouterError = (t0) => {
1275
1469
  const $ = c(12);
1276
- if ($[0] !== "5b254385a6d8e94b48b6f5b7d9a805c0a6c781995d61d22d20f368b43b726800") {
1470
+ if ($[0] !== "99b46ee567229b93d88dd5dde9a07d2a370c1710d4e834f04c33ae486b9ec8a5") {
1277
1471
  for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1278
- $[0] = "5b254385a6d8e94b48b6f5b7d9a805c0a6c781995d61d22d20f368b43b726800";
1472
+ $[0] = "99b46ee567229b93d88dd5dde9a07d2a370c1710d4e834f04c33ae486b9ec8a5";
1279
1473
  }
1280
1474
  const { error } = t0;
1281
1475
  const isError = error instanceof Error;
@@ -1293,6 +1487,7 @@ const RouterError = (t0) => {
1293
1487
  t2 = {
1294
1488
  display: "flex",
1295
1489
  alignItems: "center",
1490
+ m: 0,
1296
1491
  mb: 4
1297
1492
  };
1298
1493
  $[2] = t2;
@@ -1320,6 +1515,8 @@ const RouterError = (t0) => {
1320
1515
  let t6;
1321
1516
  if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
1322
1517
  t6 = /* @__PURE__ */ jsx(Divider, {
1518
+ component: "span",
1519
+ role: "presentation",
1323
1520
  orientation: "vertical",
1324
1521
  flexItem: true,
1325
1522
  sx: { mx: 3 }
@@ -1342,6 +1539,7 @@ const RouterError = (t0) => {
1342
1539
  t9 = /* @__PURE__ */ jsx(Fullscreen, {
1343
1540
  sx: t1,
1344
1541
  children: /* @__PURE__ */ jsxs(Box, {
1542
+ component: "h1",
1345
1543
  sx: t2,
1346
1544
  children: [
1347
1545
  t5,
@@ -1388,12 +1586,16 @@ const FOOTER_SX = {
1388
1586
  borderColor: "divider"
1389
1587
  };
1390
1588
  const pinnedWidth = (columns) => columns.reduce((total, column) => total + column.getSize(), 0);
1391
- function LayoutTable({ table, loading = false, pagination = false, pageSizeOptions = [
1392
- 10,
1393
- 25,
1394
- 50,
1395
- 100
1396
- ], showToolbar = false, disableColumnMenu = false, onRowClick, onRowDoubleClick, sx, ...toolbar }) {
1589
+ /**
1590
+ * Gives an ellipsized value (the cell itself or a noWrap Typography in it) a native
1591
+ * tooltip with its full text. Checked on hover, so it follows resizes and new data.
1592
+ */
1593
+ const titleIfTruncated = (event) => {
1594
+ const element = event.target;
1595
+ if (getComputedStyle(element).textOverflow !== "ellipsis") return;
1596
+ element.title = element.scrollWidth > element.clientWidth ? element.textContent ?? "" : "";
1597
+ };
1598
+ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS, showToolbar = false, disableColumnMenu = false, onRowClick, onRowDoubleClick, sx, ...toolbar }) {
1397
1599
  "use no memo";
1398
1600
  const { t } = useTranslation();
1399
1601
  const containerRef = useRef(null);
@@ -1411,11 +1613,24 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1411
1613
  ];
1412
1614
  const isEmpty = !loading && !rows.length;
1413
1615
  const pageSize = table.state.pagination.pageSize;
1414
- useEffect(() => {
1415
- if (!pagination && pageSize !== rows.length) table.setPageSize(Math.max(rows.length, 1));
1616
+ const pageSizeOffered = pageSizeOptions.includes(pageSize);
1617
+ const pagerStarted = useRef(false);
1618
+ useLayoutEffect(() => {
1619
+ if (!pagination) {
1620
+ if (pageSize !== rows.length) table.setPageSize(Math.max(rows.length, 1));
1621
+ return;
1622
+ }
1623
+ const appSetSize = pagerStarted.current || !!(table.options.state?.pagination ?? table.options.initialState?.pagination);
1624
+ pagerStarted.current = true;
1625
+ if (!appSetSize || !pageSizeOffered) table.setPagination({
1626
+ pageIndex: 0,
1627
+ pageSize: Math.min(...pageSizeOptions)
1628
+ });
1416
1629
  }, [
1417
1630
  pagination,
1418
1631
  pageSize,
1632
+ pageSizeOffered,
1633
+ pageSizeOptions,
1419
1634
  rows.length,
1420
1635
  table
1421
1636
  ]);
@@ -1436,15 +1651,19 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1436
1651
  }, []);
1437
1652
  const flexColumns = table.getVisibleLeafColumns().filter((column_0) => columnFlex(column_0) > 0);
1438
1653
  const totalFlex = flexColumns.reduce((total, column_1) => total + columnFlex(column_1), 0);
1439
- const flexSpace = Math.max(containerWidth - table.getTotalSize(), 0);
1440
- const flexWidths = new Map(flexColumns.map((column_2) => [column_2.id, Math.floor(flexSpace * columnFlex(column_2) / totalFlex)]));
1441
- const headerWidth = (header) => header.column.getLeafColumns().reduce((width, column_3) => width + (flexWidths.get(column_3.id) ?? 0), header.getSize());
1654
+ const flexSpace = containerWidth - table.getTotalSize();
1655
+ const flexDeltas = flexColumns.map((column_2) => [column_2.id, Math.floor(flexSpace * columnFlex(column_2) / totalFlex)]);
1656
+ const flexFits = flexColumns.every((column_3, index) => column_3.getSize() + flexDeltas[index][1] >= (column_3.columnDef.minSize ?? 20));
1657
+ const flexWidths = new Map(flexFits ? flexDeltas : []);
1658
+ const tableWidth = [...flexWidths.values()].reduce((total_0, delta) => total_0 + delta, table.getTotalSize());
1659
+ const renderedWidth = (column_4) => column_4.getSize() + (flexWidths.get(column_4.id) ?? 0);
1660
+ const headerWidth = (header) => header.column.getLeafColumns().reduce((width, column_5) => width + (flexWidths.get(column_5.id) ?? 0), header.getSize());
1442
1661
  const virtualizeColumns = headerGroups.length === 1 && !loading;
1443
1662
  const rowVirtualizer = useVirtualizer({
1444
1663
  count: rows.length,
1445
1664
  getScrollElement: () => containerRef.current,
1446
1665
  estimateSize: () => ROW_HEIGHT,
1447
- getItemKey: (index) => rows[index].id,
1666
+ getItemKey: (index_0) => rows[index_0].id,
1448
1667
  overscan: ROW_OVERSCAN,
1449
1668
  rangeExtractor: (range) => lookaheadRange(range, rowVirtualizer.scrollDirection, ROW_LOOKAHEAD),
1450
1669
  scrollMargin: headerHeight,
@@ -1453,8 +1672,8 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1453
1672
  const columnVirtualizer = useVirtualizer({
1454
1673
  count: virtualizeColumns ? centerColumns.length : 0,
1455
1674
  getScrollElement: () => containerRef.current,
1456
- estimateSize: (index_0) => centerColumns[index_0].getSize(),
1457
- getItemKey: (index_1) => centerColumns[index_1].id,
1675
+ estimateSize: (index_1) => renderedWidth(centerColumns[index_1]),
1676
+ getItemKey: (index_2) => centerColumns[index_2].id,
1458
1677
  horizontal: true,
1459
1678
  overscan: COLUMN_OVERSCAN,
1460
1679
  scrollPaddingStart: startPinnedWidth,
@@ -1463,7 +1682,11 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1463
1682
  const columnSizing = table.state.columnSizing;
1464
1683
  useEffect(() => {
1465
1684
  columnVirtualizer.measure();
1466
- }, [columnVirtualizer, columnSizing]);
1685
+ }, [
1686
+ columnVirtualizer,
1687
+ columnSizing,
1688
+ containerWidth
1689
+ ]);
1467
1690
  const focusedCell = table.getFocusedCell();
1468
1691
  const focusedRowId = focusedCell?.row.id;
1469
1692
  const focusedColumnId = focusedCell?.column.id;
@@ -1478,7 +1701,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1478
1701
  }
1479
1702
  const rowIndex = rows.findIndex((row_0) => row_0.id === focusedRowId);
1480
1703
  if (rowIndex >= 0) rowVirtualizer.scrollToIndex(rowIndex);
1481
- const columnIndex = centerColumns.findIndex((column_4) => column_4.id === focusedColumnId);
1704
+ const columnIndex = centerColumns.findIndex((column_6) => column_6.id === focusedColumnId);
1482
1705
  if (columnIndex >= 0) columnVirtualizer.scrollToIndex(columnIndex);
1483
1706
  }, [focusedRowId, focusedColumnId]);
1484
1707
  const hasCellSelection = table.state.cellSelection.length > 0;
@@ -1605,7 +1828,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1605
1828
  }
1606
1829
  },
1607
1830
  children: /* @__PURE__ */ jsx(header_0.HeaderSortLabel, { children: /* @__PURE__ */ jsx(header_0.FlexRender, {}) })
1608
- }), !disableColumnMenu && /* @__PURE__ */ jsx(header_0.HeaderMenu, {})]
1831
+ }), !disableColumnMenu && /* @__PURE__ */ jsx(header_0.HeaderMenu, { disableGrouping: pagination })]
1609
1832
  }), /* @__PURE__ */ jsx(header_0.HeaderResizeHandle, {})]
1610
1833
  });
1611
1834
  }
@@ -1619,6 +1842,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1619
1842
  tabIndex: cell_0.getCanSelect() ? cell_0.getTabIndex() : void 0,
1620
1843
  onMouseDown: cell_0.getSelectionStartHandler(),
1621
1844
  onMouseEnter: cell_0.getSelectionExtendHandler(),
1845
+ onMouseOver: titleIfTruncated,
1622
1846
  sx: {
1623
1847
  overflow: "hidden",
1624
1848
  textOverflow: "ellipsis",
@@ -1644,13 +1868,20 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1644
1868
  children: footer.isPlaceholder ? null : /* @__PURE__ */ jsx(footer.FlexRender, {})
1645
1869
  })
1646
1870
  }, f.id);
1871
+ const rowAction = onRowClick ?? onRowDoubleClick;
1647
1872
  const renderRow = (row_1) => {
1648
1873
  const cells = windowColumns(row_1.getVisibleCells());
1874
+ const focusableCells = row_1.getVisibleCells().some((cell_1) => cell_1.getCanSelect());
1649
1875
  return /* @__PURE__ */ jsxs(TableRow, {
1650
1876
  hover: true,
1651
1877
  selected: row_1.getIsSelected(),
1878
+ tabIndex: rowAction && !focusableCells ? 0 : void 0,
1652
1879
  onClick: onRowClick && (() => onRowClick(row_1)),
1653
1880
  onDoubleClick: onRowDoubleClick && (() => onRowDoubleClick(row_1)),
1881
+ onKeyDown: rowAction && ((event) => {
1882
+ const target = event.target;
1883
+ if (event.key === "Enter" && (target === event.currentTarget || target.tagName === "TD")) rowAction(row_1);
1884
+ }),
1654
1885
  sx: {
1655
1886
  height: ROW_HEIGHT,
1656
1887
  cursor: onRowClick || onRowDoubleClick ? "pointer" : void 0
@@ -1675,7 +1906,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1675
1906
  paddingStart,
1676
1907
  paddingEnd
1677
1908
  ]);
1678
- const bodyRows = virtualRows.map(({ index: index_2 }) => rowCache.current.get(rows[index_2].id) ?? renderRow(rows[index_2]));
1909
+ const bodyRows = virtualRows.map(({ index: index_3 }) => rowCache.current.get(rows[index_3].id) ?? renderRow(rows[index_3]));
1679
1910
  rowCache.current = new Map(bodyRows.map((row_2) => [row_2.key, row_2]));
1680
1911
  /** Reserves the scroll height of the rows outside the virtual window. */
1681
1912
  const skippedRows = (height) => height > 0 ? /* @__PURE__ */ jsx(TableRow, {
@@ -1714,12 +1945,14 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1714
1945
  children: /* @__PURE__ */ jsxs(Table, {
1715
1946
  stickyHeader: true,
1716
1947
  size: "small",
1948
+ "aria-busy": loading,
1949
+ "aria-label": typeof toolbar.title === "string" ? toolbar.title : void 0,
1717
1950
  sx: {
1718
1951
  tableLayout: "fixed",
1719
- width: table.getTotalSize(),
1952
+ width: tableWidth,
1720
1953
  minWidth: "100%",
1721
1954
  "& tbody .MuiTableRow-root:last-of-type .MuiTableCell-root": { borderBottom: 0 },
1722
- "& .MuiTableCell-root:focus": {
1955
+ "& .MuiTableCell-root:focus, & .MuiTableRow-root:focus-visible": {
1723
1956
  outline: "1px solid",
1724
1957
  outlineColor: "primary.main",
1725
1958
  outlineOffset: -1
@@ -1823,7 +2056,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
1823
2056
  ]
1824
2057
  })
1825
2058
  }),
1826
- pagination && /* @__PURE__ */ jsx(table.Pagination, { pageSizeOptions })
2059
+ pagination && pageSizeOffered && /* @__PURE__ */ jsx(table.Pagination, { pageSizeOptions })
1827
2060
  ]
1828
2061
  }) });
1829
2062
  }