@bindu-dashing/dam-solution-v2 5.8.155 → 5.8.156

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.
@@ -12,6 +12,6 @@ const FileViewer = ({ file, onNext, onPrev, hasNext, hasPrev, handleClose, }) =>
12
12
  const brand = damConfig === null || damConfig === void 0 ? void 0 : damConfig.brand;
13
13
  const showFilePreview = get(brand, "showFilePreview", false);
14
14
  const [metadataOpen, setMetadataOpen] = useState(showFilePreview);
15
- return (_jsx(Layout, { className: "md-lib-h-full", children: _jsxs(Content, { className: "md-lib-flex md-lib-h-full md-lib-w-full", children: [_jsx("div", { className: `md-lib-flex md-lib-items-center md-lib-justify-center md-lib-relative md-lib-bg-textColorActive dark:md-lib-bg-darkSecondaryColor md-lib-min-h-full ${metadataOpen ? "md-lib-flex-1" : "md-lib-flex-1 md-lib-w-full"}`, children: _jsx(PreviewDetails, { file: file, hasNext: hasNext, hasPrev: hasPrev, onNext: onNext, onPrev: onPrev }) }), showFilePreview && (_jsxs(_Fragment, { children: [_jsx(Button, { type: "text", className: "md-lib-shrink-0 md-lib-flex md-lib-items-center md-lib-justify-center md-lib-w-10 md-lib-h-10 md-lib-rounded-none md-lib-bg-black/50 hover:md-lib-bg-black/70 dark:md-lib-bg-white/20 dark:hover:md-lib-bg-white/30 md-lib-text-white md-lib-border-0 md-lib-self-start md-lib-mt-4", onClick: () => setMetadataOpen((prev) => !prev), "aria-label": metadataOpen ? "Hide showFilePreviewEditor" : "Show showFilePreviewEditor", children: metadataOpen ? (_jsx(RightOutlined, { className: "md-lib-text-lg" })) : (_jsx(LeftOutlined, { className: "md-lib-text-lg" })) }), metadataOpen && (_jsx("div", { className: "md-lib-w-[400px] md-lib-min-w-[320px] md-lib-shrink-0 md-lib-border-l md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-bg-backgroundColor dark:md-lib-bg-darkPrimary md-lib-overflow-y-auto", children: _jsx(MapFile, { fromUpload: false, filesList: file ? [file] : [], handleCancel: handleClose ? () => handleClose() : undefined }) }))] }))] }) }));
15
+ return (_jsx(Layout, { className: "md-lib-h-full", children: _jsxs(Content, { className: "md-lib-flex md-lib-h-full md-lib-w-full", children: [_jsx("div", { className: `md-lib-flex md-lib-items-center md-lib-justify-center md-lib-relative md-lib-bg-textColorActive dark:md-lib-bg-darkSecondaryColor md-lib-min-h-full ${metadataOpen ? "md-lib-flex-1" : "md-lib-flex-1 md-lib-w-full"}`, children: _jsx(PreviewDetails, { file: file, hasNext: hasNext, hasPrev: hasPrev, onNext: onNext, onPrev: onPrev, showFilePreview: showFilePreview }) }), showFilePreview && (_jsxs(_Fragment, { children: [_jsx(Button, { type: "text", className: "md-lib-shrink-0 md-lib-flex md-lib-items-center md-lib-justify-center md-lib-w-10 md-lib-h-10 md-lib-rounded-none md-lib-bg-black/50 hover:md-lib-bg-black/70 dark:md-lib-bg-white/20 dark:hover:md-lib-bg-white/30 md-lib-text-white md-lib-border-0 md-lib-self-start md-lib-mt-4", onClick: () => setMetadataOpen((prev) => !prev), "aria-label": metadataOpen ? "Hide showFilePreviewEditor" : "Show showFilePreviewEditor", children: metadataOpen ? (_jsx(RightOutlined, { className: "md-lib-text-lg" })) : (_jsx(LeftOutlined, { className: "md-lib-text-lg" })) }), metadataOpen && (_jsx("div", { className: "md-lib-w-[400px] md-lib-min-w-[320px] md-lib-shrink-0 md-lib-border-l md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-bg-backgroundColor dark:md-lib-bg-darkPrimary md-lib-overflow-y-auto", children: _jsx(MapFile, { fromUpload: false, filesList: file ? [file] : [], handleCancel: handleClose ? () => handleClose() : undefined }) }))] }))] }) }));
16
16
  };
17
17
  export default FileViewer;
@@ -1,5 +1,6 @@
1
1
  import { FileEntity } from "../../utilities/constants/interface";
2
- declare const ImageViewer: ({ file }: {
2
+ declare const ImageViewer: ({ file, showFilePreview }: {
3
3
  file: FileEntity;
4
+ showFilePreview?: boolean;
4
5
  }) => JSX.Element;
5
6
  export default ImageViewer;
@@ -4,13 +4,13 @@ import ImageOptions from "./ImageOptions";
4
4
  import { useState } from "react";
5
5
  import { SAMPLE_IMAGE_URL } from "../../utilities/constants/imageUrls";
6
6
  import { useDamConfig } from "../../hocs/DamConfigContext";
7
- const ImageViewer = ({ file }) => {
7
+ const ImageViewer = ({ file, showFilePreview }) => {
8
8
  const damConfig = useDamConfig();
9
9
  const { isAdmin } = damConfig;
10
10
  const [zoom, setZoom] = useState("100");
11
11
  const zoomOptions = ["10", "25", "50", "75", "100"];
12
12
  const imgWidth = 750 * (parseInt(zoom) / 100);
13
13
  // const imgHeight = 333 * (parseInt(zoom) / 100);
14
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "md-lib-relative md-lib-flex md-lib-justify-center md-lib-items-center md-lib-h-[calc(100vh-65px)] md-lib-w-full md-lib-overflow-x-auto", children: _jsx("img", { src: get(file, "s3Url") || get(file, "downloadUrl") || get(file, "thumbnailUrl", SAMPLE_IMAGE_URL), alt: get(file, "name", ""), width: imgWidth, height: "auto" }) }), isAdmin && (_jsx(ImageOptions, { zoom: zoom, setZoom: setZoom, zoomOptions: zoomOptions, file: file }))] }));
14
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "md-lib-relative md-lib-flex md-lib-justify-center md-lib-items-center md-lib-h-[calc(100vh-65px)] md-lib-w-full md-lib-overflow-x-auto", children: _jsx("img", { src: get(file, "s3Url") || get(file, "downloadUrl") || get(file, "thumbnailUrl", SAMPLE_IMAGE_URL), alt: get(file, "name", ""), width: imgWidth, height: "auto" }) }), showFilePreview && (_jsx(ImageOptions, { zoom: zoom, setZoom: setZoom, zoomOptions: zoomOptions, file: file }))] }));
15
15
  };
16
16
  export default ImageViewer;
@@ -1,9 +1,10 @@
1
1
  import { FileEntity } from "../../utilities/constants/interface";
2
- declare const PreviewDetails: ({ file, hasPrev, hasNext, onPrev, onNext, }: {
2
+ declare const PreviewDetails: ({ file, hasPrev, hasNext, onPrev, onNext, showFilePreview, }: {
3
3
  file: FileEntity;
4
4
  hasPrev: boolean;
5
5
  hasNext: boolean;
6
6
  onPrev: () => void;
7
7
  onNext: () => void;
8
+ showFilePreview?: boolean;
8
9
  }) => JSX.Element;
9
10
  export default PreviewDetails;
@@ -9,12 +9,12 @@ import useAppParams from "../../utilities/useAppParams";
9
9
  // const PDFViewer = lazy(() => import("./PdfViewer"));
10
10
  const GoArrowLeftIcon = GoArrowLeft;
11
11
  const GoArrowRightIcon = GoArrowRight;
12
- const PreviewDetails = ({ file, hasPrev, hasNext, onPrev, onNext, }) => {
12
+ const PreviewDetails = ({ file, hasPrev, hasNext, onPrev, onNext, showFilePreview, }) => {
13
13
  const { id } = useAppParams();
14
14
  const mimetype = get(file, "mimetype", "");
15
15
  const fileComponent = useMemo(() => {
16
16
  if (startsWith(mimetype, "image/")) {
17
- return _jsx(ImageViewer, { file: file });
17
+ return _jsx(ImageViewer, { file: file, showFilePreview: showFilePreview });
18
18
  }
19
19
  else if (startsWith(mimetype, "video/")) {
20
20
  return _jsx(VideoPlayer, { src: get(file, "s3Url") || get(file, "downloadUrl") || get(file, "thumbnailUrl", "") });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bindu-dashing/dam-solution-v2",
3
- "version": "5.8.155",
3
+ "version": "5.8.156",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.0.1",
6
6
  "@emoji-mart/data": "^1.2.1",