wcz-layout 9.4.1 → 9.4.3

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.
@@ -1,5 +1,5 @@
1
1
  import { n as RouterIconButton, t as RouterListItemButton } from "./RouterListItemButton-owZVvuC_.mjs";
2
- import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-C5-a_6W6.mjs";
2
+ import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-bckp9fpa.mjs";
3
3
  import { t as useDialogs } from "./useDialogs-BUzVrTSP.mjs";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { Box, Button, CircularProgress, Dialog, Divider, Fab, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItemButton, ListItemIcon, ListItemText, Menu, Skeleton, Stack, Tab, Tooltip, Typography, useTheme } from "@mui/material";
@@ -215,9 +215,9 @@ const baseStyle = {
215
215
  };
216
216
  const Dropzone = (t0) => {
217
217
  const $ = c(32);
218
- if ($[0] !== "82c770c45377ab601777291a216aa1889d6ec92458acfb8e98e4900f981e436b") {
218
+ if ($[0] !== "b5bf5b5d281edd44834873bfefae09761c13d535bf60e1ff80df8ed9edd6a03b") {
219
219
  for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
220
- $[0] = "82c770c45377ab601777291a216aa1889d6ec92458acfb8e98e4900f981e436b";
220
+ $[0] = "b5bf5b5d281edd44834873bfefae09761c13d535bf60e1ff80df8ed9edd6a03b";
221
221
  }
222
222
  let progress;
223
223
  let props;
@@ -344,9 +344,9 @@ const useFile = () => {
344
344
  //#region src/components/file/fileViewer/common/ActionsMenu.tsx
345
345
  const ActionsMenu = (t0) => {
346
346
  const $ = c(43);
347
- if ($[0] !== "6eb84d1b42ada694d43e5cfc1e200edbb4eef104bdd9b5612054591d9c8531c5") {
347
+ if ($[0] !== "37413a10a2df1dbf561819b83375455df60d2eb9e9781fbb0853c0e5c2f8a772") {
348
348
  for (let $i = 0; $i < 43; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
349
- $[0] = "6eb84d1b42ada694d43e5cfc1e200edbb4eef104bdd9b5612054591d9c8531c5";
349
+ $[0] = "37413a10a2df1dbf561819b83375455df60d2eb9e9781fbb0853c0e5c2f8a772";
350
350
  }
351
351
  const { meta, menu, setMenu } = t0;
352
352
  const { t } = useTranslation();
@@ -497,9 +497,9 @@ const ActionsMenu = (t0) => {
497
497
  const IMAGE_SIZE = 150;
498
498
  const FileViewerGrid = (t0) => {
499
499
  const $ = c(13);
500
- if ($[0] !== "5d77705eb7d3c9a0156b26bd48f623dca912b69c2621470852f3a952a02eb0ba") {
500
+ if ($[0] !== "bc5b647583214f754be7f38d757996f0eba6fa435240965b8abc15fa6f9a6a5c") {
501
501
  for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
502
- $[0] = "5d77705eb7d3c9a0156b26bd48f623dca912b69c2621470852f3a952a02eb0ba";
502
+ $[0] = "bc5b647583214f754be7f38d757996f0eba6fa435240965b8abc15fa6f9a6a5c";
503
503
  }
504
504
  const { sx, size, itemBar } = t0;
505
505
  const { fileMetas } = useFile();
@@ -545,139 +545,61 @@ const FileViewerGrid = (t0) => {
545
545
  } else t3 = $[12];
546
546
  return t3;
547
547
  };
548
- const GridFileViewerItem = (t0) => {
549
- const $ = c(56);
550
- if ($[0] !== "5d77705eb7d3c9a0156b26bd48f623dca912b69c2621470852f3a952a02eb0ba") {
551
- for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
552
- $[0] = "5d77705eb7d3c9a0156b26bd48f623dca912b69c2621470852f3a952a02eb0ba";
553
- }
554
- const { meta, size, itemBar } = t0;
548
+ const GridFileViewerItem = ({ meta, size, itemBar }) => {
555
549
  const { setImageId, actions, appName } = useFile();
556
550
  const [showItemBar, setShowItemBar] = useState(itemBar === "always");
557
551
  const [menu, setMenu] = useState(null);
558
552
  const { ref, inView } = useInView();
559
553
  const queryClient = useQueryClient();
560
- let t1;
561
- let t2;
562
- if ($[1] !== itemBar) {
563
- t1 = () => {
564
- setShowItemBar(itemBar === "always");
565
- };
566
- t2 = [itemBar];
567
- $[1] = itemBar;
568
- $[2] = t1;
569
- $[3] = t2;
570
- } else {
571
- t1 = $[2];
572
- t2 = $[3];
573
- }
574
- useEffect(t1, t2);
575
- let t3;
576
- if ($[4] !== appName || $[5] !== meta.id) {
577
- t3 = fileThumbnailQueryOptions({
554
+ const target = useRef(null);
555
+ useEffect(() => {
556
+ setShowItemBar(itemBar === "always");
557
+ }, [itemBar]);
558
+ const { data: source, isPending } = useQuery({
559
+ ...fileThumbnailQueryOptions({
578
560
  id: meta.id,
579
561
  appName
580
- });
581
- $[4] = appName;
582
- $[5] = meta.id;
583
- $[6] = t3;
584
- } else t3 = $[6];
585
- let t4;
586
- if ($[7] !== inView || $[8] !== t3) {
587
- t4 = {
588
- ...t3,
589
- enabled: inView
590
- };
591
- $[7] = inView;
592
- $[8] = t3;
593
- $[9] = t4;
594
- } else t4 = $[9];
595
- const { data: source, isPending } = useQuery(t4);
596
- let t5;
597
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
598
- t5 = () => setShowItemBar(true);
599
- $[10] = t5;
600
- } else t5 = $[10];
601
- const handleOnMouseEnter = t5;
602
- let t6;
603
- if ($[11] !== itemBar) {
604
- t6 = () => itemBar !== "always" && setShowItemBar(false);
605
- $[11] = itemBar;
606
- $[12] = t6;
607
- } else t6 = $[12];
608
- const handleOnMouseLeave = t6;
609
- let t7;
610
- if ($[13] !== menu) {
611
- t7 = (event) => {
612
- setMenu(menu === null ? {
613
- mouseX: event.clientX,
614
- mouseY: event.clientY
615
- } : null);
616
- setTimeout(() => setShowItemBar(true));
617
- };
618
- $[13] = menu;
619
- $[14] = t7;
620
- } else t7 = $[14];
621
- const openMenu = t7;
622
- let t8;
623
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
624
- t8 = openFileMutationOptions();
625
- $[15] = t8;
626
- } else t8 = $[15];
627
- const { mutate: openFile } = useMutation(t8);
628
- let t9;
629
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
630
- t9 = downloadFileMutationOptions();
631
- $[16] = t9;
632
- } else t9 = $[16];
633
- const { mutate: download } = useMutation(t9);
634
- let t10;
635
- if ($[17] !== appName || $[18] !== download || $[19] !== meta.fileExtension || $[20] !== meta.fileName || $[21] !== meta.id || $[22] !== meta.mediaType || $[23] !== openFile || $[24] !== setImageId) {
636
- t10 = () => {
637
- switch (meta.mediaType) {
638
- case "image": return setImageId(meta.id);
639
- case "application": return openFile({
640
- id: meta.id,
641
- appName
642
- });
643
- case "video": return openFile({
562
+ }),
563
+ enabled: inView
564
+ });
565
+ const handleOnMouseEnter = () => setShowItemBar(true);
566
+ const handleOnMouseLeave = () => itemBar !== "always" && setShowItemBar(false);
567
+ const openMenu = (event) => {
568
+ setMenu(menu === null ? {
569
+ mouseX: event.clientX,
570
+ mouseY: event.clientY
571
+ } : null);
572
+ setTimeout(() => setShowItemBar(true));
573
+ };
574
+ const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));
575
+ const { mutate: download } = useMutation(downloadFileMutationOptions());
576
+ const onClick = () => {
577
+ switch (meta.mediaType) {
578
+ case "image": return setImageId(meta.id);
579
+ case "application":
580
+ case "video":
581
+ target.current = window.open("about:blank", "_blank");
582
+ return openFile({
644
583
  id: meta.id,
645
584
  appName
646
585
  });
647
- default: return download({
648
- id: meta.id,
649
- appName,
650
- fileName: meta.fileName,
651
- fileExtension: meta.fileExtension
652
- });
653
- }
654
- };
655
- $[17] = appName;
656
- $[18] = download;
657
- $[19] = meta.fileExtension;
658
- $[20] = meta.fileName;
659
- $[21] = meta.id;
660
- $[22] = meta.mediaType;
661
- $[23] = openFile;
662
- $[24] = setImageId;
663
- $[25] = t10;
664
- } else t10 = $[25];
665
- const onClick = t10;
666
- const t11 = size ?? IMAGE_SIZE;
667
- const t12 = size ?? IMAGE_SIZE;
668
- let t13;
669
- if ($[26] !== t11 || $[27] !== t12) {
670
- t13 = {
671
- width: t11,
672
- height: t12
673
- };
674
- $[26] = t11;
675
- $[27] = t12;
676
- $[28] = t13;
677
- } else t13 = $[28];
678
- let t14;
679
- if ($[29] !== appName || $[30] !== isPending || $[31] !== meta.id || $[32] !== onClick || $[33] !== queryClient || $[34] !== size || $[35] !== source) {
680
- t14 = isPending ? /* @__PURE__ */ jsx(Skeleton, {
586
+ default: return download({
587
+ id: meta.id,
588
+ appName,
589
+ fileName: meta.fileName,
590
+ fileExtension: meta.fileExtension
591
+ });
592
+ }
593
+ };
594
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ImageListItem, {
595
+ sx: {
596
+ width: size ?? IMAGE_SIZE,
597
+ height: size ?? IMAGE_SIZE
598
+ },
599
+ onMouseEnter: handleOnMouseEnter,
600
+ onMouseLeave: handleOnMouseLeave,
601
+ ref,
602
+ children: [isPending ? /* @__PURE__ */ jsx(Skeleton, {
681
603
  variant: "rectangular",
682
604
  width: size ?? IMAGE_SIZE,
683
605
  height: size ?? IMAGE_SIZE
@@ -697,19 +619,7 @@ const GridFileViewerItem = (t0) => {
697
619
  width: size ?? IMAGE_SIZE,
698
620
  height: size ?? IMAGE_SIZE
699
621
  }
700
- });
701
- $[29] = appName;
702
- $[30] = isPending;
703
- $[31] = meta.id;
704
- $[32] = onClick;
705
- $[33] = queryClient;
706
- $[34] = size;
707
- $[35] = source;
708
- $[36] = t14;
709
- } else t14 = $[36];
710
- let t15;
711
- if ($[37] !== actions || $[38] !== itemBar || $[39] !== meta.fileName || $[40] !== openMenu || $[41] !== showItemBar) {
712
- t15 = itemBar !== "hidden" && showItemBar && /* @__PURE__ */ jsx(ImageListItemBar, {
622
+ }), itemBar !== "hidden" && showItemBar && /* @__PURE__ */ jsx(ImageListItemBar, {
713
623
  title: /* @__PURE__ */ jsx(Tooltip, {
714
624
  title: meta.fileName,
715
625
  children: /* @__PURE__ */ jsx(Box, { children: meta.fileName })
@@ -720,58 +630,20 @@ const GridFileViewerItem = (t0) => {
720
630
  "aria-label": "File actions",
721
631
  children: /* @__PURE__ */ jsx(MoreVert, {})
722
632
  })
723
- });
724
- $[37] = actions;
725
- $[38] = itemBar;
726
- $[39] = meta.fileName;
727
- $[40] = openMenu;
728
- $[41] = showItemBar;
729
- $[42] = t15;
730
- } else t15 = $[42];
731
- let t16;
732
- if ($[43] !== handleOnMouseLeave || $[44] !== ref || $[45] !== t13 || $[46] !== t14 || $[47] !== t15) {
733
- t16 = /* @__PURE__ */ jsxs(ImageListItem, {
734
- sx: t13,
735
- onMouseEnter: handleOnMouseEnter,
736
- onMouseLeave: handleOnMouseLeave,
737
- ref,
738
- children: [t14, t15]
739
- });
740
- $[43] = handleOnMouseLeave;
741
- $[44] = ref;
742
- $[45] = t13;
743
- $[46] = t14;
744
- $[47] = t15;
745
- $[48] = t16;
746
- } else t16 = $[48];
747
- let t17;
748
- if ($[49] !== actions || $[50] !== menu || $[51] !== meta) {
749
- t17 = (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(ActionsMenu, {
750
- meta,
751
- menu,
752
- setMenu
753
- });
754
- $[49] = actions;
755
- $[50] = menu;
756
- $[51] = meta;
757
- $[52] = t17;
758
- } else t17 = $[52];
759
- let t18;
760
- if ($[53] !== t16 || $[54] !== t17) {
761
- t18 = /* @__PURE__ */ jsxs(Fragment, { children: [t16, t17] });
762
- $[53] = t16;
763
- $[54] = t17;
764
- $[55] = t18;
765
- } else t18 = $[55];
766
- return t18;
633
+ })]
634
+ }), (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(ActionsMenu, {
635
+ meta,
636
+ menu,
637
+ setMenu
638
+ })] });
767
639
  };
768
640
  //#endregion
769
641
  //#region src/components/file/fileViewer/FileViewerList.tsx
770
642
  const FileViewerList = (t0) => {
771
643
  const $ = c(6);
772
- if ($[0] !== "a4215cc2ecb024896765e7f105faef1183c309efe5e27865642494da8f087679") {
644
+ if ($[0] !== "e722a3273480830659aee3fb7ea3f313b724a6b70ec66bb9e867418a71728eba") {
773
645
  for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
774
- $[0] = "a4215cc2ecb024896765e7f105faef1183c309efe5e27865642494da8f087679";
646
+ $[0] = "e722a3273480830659aee3fb7ea3f313b724a6b70ec66bb9e867418a71728eba";
775
647
  }
776
648
  const { sx } = t0;
777
649
  const { fileMetas } = useFile();
@@ -794,161 +666,66 @@ const FileViewerList = (t0) => {
794
666
  } else t2 = $[5];
795
667
  return t2;
796
668
  };
797
- const ListFileViewerItem = (t0) => {
798
- const $ = c(41);
799
- if ($[0] !== "a4215cc2ecb024896765e7f105faef1183c309efe5e27865642494da8f087679") {
800
- for (let $i = 0; $i < 41; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
801
- $[0] = "a4215cc2ecb024896765e7f105faef1183c309efe5e27865642494da8f087679";
802
- }
803
- const { meta } = t0;
669
+ const ListFileViewerItem = ({ meta }) => {
804
670
  const { setImageId, actions, appName } = useFile();
805
671
  const [menu, setMenu] = useState(null);
806
672
  const queryClient = useQueryClient();
807
- let t1;
808
- if ($[1] !== menu) {
809
- t1 = (event) => {
810
- event.stopPropagation();
811
- setMenu(menu === null ? {
812
- mouseX: event.clientX,
813
- mouseY: event.clientY
814
- } : null);
815
- };
816
- $[1] = menu;
817
- $[2] = t1;
818
- } else t1 = $[2];
819
- const openMenu = t1;
820
- let t2;
821
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
822
- t2 = openFileMutationOptions();
823
- $[3] = t2;
824
- } else t2 = $[3];
825
- const { mutate: openFile } = useMutation(t2);
826
- let t3;
827
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
828
- t3 = downloadFileMutationOptions();
829
- $[4] = t3;
830
- } else t3 = $[4];
831
- const { mutate: download } = useMutation(t3);
832
- let t4;
833
- if ($[5] !== appName || $[6] !== download || $[7] !== meta.fileExtension || $[8] !== meta.fileName || $[9] !== meta.id || $[10] !== meta.mediaType || $[11] !== openFile || $[12] !== setImageId) {
834
- t4 = () => {
835
- switch (meta.mediaType) {
836
- case "image": return setImageId(meta.id);
837
- case "application": return openFile({
838
- id: meta.id,
839
- appName
840
- });
841
- case "video": return openFile({
673
+ const target = useRef(null);
674
+ const openMenu = (event) => {
675
+ event.stopPropagation();
676
+ setMenu(menu === null ? {
677
+ mouseX: event.clientX,
678
+ mouseY: event.clientY
679
+ } : null);
680
+ };
681
+ const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));
682
+ const { mutate: download } = useMutation(downloadFileMutationOptions());
683
+ const onClick = () => {
684
+ switch (meta.mediaType) {
685
+ case "image": return setImageId(meta.id);
686
+ case "application":
687
+ case "video":
688
+ target.current = window.open("about:blank", "_blank");
689
+ return openFile({
842
690
  id: meta.id,
843
691
  appName
844
692
  });
845
- default: return download({
846
- id: meta.id,
847
- appName,
848
- fileName: meta.fileName,
849
- fileExtension: meta.fileExtension
850
- });
851
- }
852
- };
853
- $[5] = appName;
854
- $[6] = download;
855
- $[7] = meta.fileExtension;
856
- $[8] = meta.fileName;
857
- $[9] = meta.id;
858
- $[10] = meta.mediaType;
859
- $[11] = openFile;
860
- $[12] = setImageId;
861
- $[13] = t4;
862
- } else t4 = $[13];
863
- const onClick = t4;
864
- let t5;
865
- if ($[14] !== meta.mediaType) {
866
- t5 = () => {
867
- switch (meta.mediaType) {
868
- case "image": return /* @__PURE__ */ jsx(Image, {});
869
- case "video": return /* @__PURE__ */ jsx(SmartDisplay, {});
870
- default: return /* @__PURE__ */ jsx(AttachFile, {});
871
- }
872
- };
873
- $[14] = meta.mediaType;
874
- $[15] = t5;
875
- } else t5 = $[15];
876
- const icon = t5;
877
- let t6;
878
- if ($[16] !== appName || $[17] !== meta.id || $[18] !== queryClient) {
879
- t6 = () => queryClient.prefetchQuery(fileQueryOptions({
693
+ default: return download({
694
+ id: meta.id,
695
+ appName,
696
+ fileName: meta.fileName,
697
+ fileExtension: meta.fileExtension
698
+ });
699
+ }
700
+ };
701
+ const icon = () => {
702
+ switch (meta.mediaType) {
703
+ case "image": return /* @__PURE__ */ jsx(Image, {});
704
+ case "video": return /* @__PURE__ */ jsx(SmartDisplay, {});
705
+ default: return /* @__PURE__ */ jsx(AttachFile, {});
706
+ }
707
+ };
708
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ListItemButton, {
709
+ onClick,
710
+ onMouseEnter: () => queryClient.prefetchQuery(fileQueryOptions({
880
711
  id: meta.id,
881
712
  appName
882
- }));
883
- $[16] = appName;
884
- $[17] = meta.id;
885
- $[18] = queryClient;
886
- $[19] = t6;
887
- } else t6 = $[19];
888
- let t7;
889
- if ($[20] !== icon) {
890
- t7 = /* @__PURE__ */ jsx(ListItemIcon, { children: icon() });
891
- $[20] = icon;
892
- $[21] = t7;
893
- } else t7 = $[21];
894
- const t8 = `${meta.fileName}.${meta.fileExtension}`;
895
- let t9;
896
- if ($[22] !== t8) {
897
- t9 = /* @__PURE__ */ jsx(ListItemText, { primary: t8 });
898
- $[22] = t8;
899
- $[23] = t9;
900
- } else t9 = $[23];
901
- let t10;
902
- if ($[24] !== actions || $[25] !== openMenu) {
903
- t10 = (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(IconButton, {
904
- edge: "end",
905
- onClick: openMenu,
906
- "aria-label": "File actions",
907
- children: /* @__PURE__ */ jsx(MoreVert, {})
908
- });
909
- $[24] = actions;
910
- $[25] = openMenu;
911
- $[26] = t10;
912
- } else t10 = $[26];
913
- let t11;
914
- if ($[27] !== meta.id || $[28] !== onClick || $[29] !== t10 || $[30] !== t6 || $[31] !== t7 || $[32] !== t9) {
915
- t11 = /* @__PURE__ */ jsxs(ListItemButton, {
916
- onClick,
917
- onMouseEnter: t6,
918
- children: [
919
- t7,
920
- t9,
921
- t10
922
- ]
923
- }, meta.id);
924
- $[27] = meta.id;
925
- $[28] = onClick;
926
- $[29] = t10;
927
- $[30] = t6;
928
- $[31] = t7;
929
- $[32] = t9;
930
- $[33] = t11;
931
- } else t11 = $[33];
932
- let t12;
933
- if ($[34] !== actions || $[35] !== menu || $[36] !== meta) {
934
- t12 = (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(ActionsMenu, {
935
- meta,
936
- menu,
937
- setMenu
938
- });
939
- $[34] = actions;
940
- $[35] = menu;
941
- $[36] = meta;
942
- $[37] = t12;
943
- } else t12 = $[37];
944
- let t13;
945
- if ($[38] !== t11 || $[39] !== t12) {
946
- t13 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t12] });
947
- $[38] = t11;
948
- $[39] = t12;
949
- $[40] = t13;
950
- } else t13 = $[40];
951
- return t13;
713
+ })),
714
+ children: [
715
+ /* @__PURE__ */ jsx(ListItemIcon, { children: icon() }),
716
+ /* @__PURE__ */ jsx(ListItemText, { primary: `${meta.fileName}.${meta.fileExtension}` }),
717
+ (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(IconButton, {
718
+ edge: "end",
719
+ onClick: openMenu,
720
+ "aria-label": "File actions",
721
+ children: /* @__PURE__ */ jsx(MoreVert, {})
722
+ })
723
+ ]
724
+ }, meta.id), (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx(ActionsMenu, {
725
+ meta,
726
+ menu,
727
+ setMenu
728
+ })] });
952
729
  };
953
730
  function _temp(fileMeta) {
954
731
  return /* @__PURE__ */ jsx(ListFileViewerItem, { meta: fileMeta }, fileMeta.id);