@appquality/unguess-design-system 3.1.95-beta-attachments → 3.1.96-beta-attachments

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.
package/build/index.js CHANGED
@@ -3416,7 +3416,7 @@ const Preview$1 = styled__default["default"].div `
3416
3416
  background-position: center;
3417
3417
  background-repeat: no-repeat;
3418
3418
  `;
3419
- const ImageThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = false, isError = false, }) => {
3419
+ const ImageThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = true, isError = false, }) => {
3420
3420
  const handleCancel = (e) => {
3421
3421
  e.stopPropagation();
3422
3422
  if (removeThumbnail)
@@ -3494,7 +3494,7 @@ const Preview = styled__default["default"].div `
3494
3494
  height: 100%;
3495
3495
  }
3496
3496
  `;
3497
- const VideoThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = false, isError = false, }) => {
3497
+ const VideoThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = true, isError = false, }) => {
3498
3498
  const handleCancel = (e) => {
3499
3499
  e.stopPropagation();
3500
3500
  if (removeThumbnail)
@@ -3532,7 +3532,7 @@ const StyledCol$1 = styled__default["default"](reactGrid.Col) `
3532
3532
  `;
3533
3533
  const Col = (props) => jsxRuntime.jsx(StyledCol$1, Object.assign({}, props));
3534
3534
 
3535
- const ThumbnailContainer = ({ openLightbox, }) => {
3535
+ const ThumbnailContainer = ({ openLightbox }) => {
3536
3536
  const { thumbnails, removeThumbnail, onDeleteThumbnail } = useChatContext();
3537
3537
  if (!thumbnails || thumbnails.length === 0) {
3538
3538
  return null;
@@ -3542,7 +3542,6 @@ const ThumbnailContainer = ({ openLightbox, }) => {
3542
3542
  mediaFiles.push({
3543
3543
  fileName: file.name,
3544
3544
  fileType: file.type,
3545
- status: file.isLoadingMedia ? "uploading" : "success",
3546
3545
  previewUrl: URL.createObjectURL(file),
3547
3546
  internal_id: file.internal_id,
3548
3547
  });
@@ -3553,14 +3552,14 @@ const ThumbnailContainer = ({ openLightbox, }) => {
3553
3552
  return (jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: mediaFiles.map((file, index) => {
3554
3553
  // Check if item is an image or a video
3555
3554
  if (file.fileType.includes("image"))
3556
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, xl: 3, lg: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.status === "uploading", removeThumbnail: () => {
3555
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, xl: 3, lg: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: true, removeThumbnail: () => {
3557
3556
  removeThumbnail(index);
3558
3557
  onDeleteThumbnail(file.internal_id);
3559
3558
  }, clickThumbnail: () => {
3560
3559
  openLightbox(thumbnails[index], index);
3561
3560
  } }, index) })));
3562
3561
  if (file.fileType.includes("video"))
3563
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.status === "uploading", removeThumbnail: () => {
3562
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: true, removeThumbnail: () => {
3564
3563
  removeThumbnail(index);
3565
3564
  onDeleteThumbnail(file.internal_id);
3566
3565
  }, clickThumbnail: () => {
@@ -1,7 +1,6 @@
1
1
  export interface FileElement {
2
2
  fileName: string;
3
3
  fileType: string;
4
- status: "success" | "failed" | "uploading";
5
4
  errorCode?: "FILE_TOO_BIG" | "INVALID_FILE_EXTENSION" | "GENERIC_ERROR";
6
5
  previewUrl: string;
7
6
  internal_id: string;
@@ -9,5 +8,5 @@ export interface FileElement {
9
8
  interface Props {
10
9
  openLightbox: (file: File, index: number) => void;
11
10
  }
12
- declare const ThumbnailContainer: ({ openLightbox, }: Props) => import("react/jsx-runtime").JSX.Element | null;
11
+ declare const ThumbnailContainer: ({ openLightbox }: Props) => import("react/jsx-runtime").JSX.Element | null;
13
12
  export default ThumbnailContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.95-beta-attachments",
3
+ "version": "3.1.96-beta-attachments",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",