@solidxai/core-ui 0.1.13-beta.1 → 0.1.13-beta.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.
Files changed (94) hide show
  1. package/dist/components/common/SolidFieldTooltip.d.ts.map +1 -1
  2. package/dist/components/common/SolidFieldTooltip.js +33 -1
  3. package/dist/components/common/SolidFieldTooltip.js.map +1 -1
  4. package/dist/components/common/SolidFieldTooltip.tsx +64 -8
  5. package/dist/components/core/chatter/SolidChatter.d.ts.map +1 -1
  6. package/dist/components/core/chatter/SolidChatter.js +4 -2
  7. package/dist/components/core/chatter/SolidChatter.js.map +1 -1
  8. package/dist/components/core/chatter/SolidChatter.tsx +4 -1
  9. package/dist/components/core/chatter/SolidChatterMentionMenu.d.ts +9 -0
  10. package/dist/components/core/chatter/SolidChatterMentionMenu.d.ts.map +1 -0
  11. package/dist/components/core/chatter/SolidChatterMentionMenu.js +18 -0
  12. package/dist/components/core/chatter/SolidChatterMentionMenu.js.map +1 -0
  13. package/dist/components/core/chatter/SolidChatterMentionMenu.tsx +45 -0
  14. package/dist/components/core/chatter/SolidChatterMessageBox.d.ts +1 -0
  15. package/dist/components/core/chatter/SolidChatterMessageBox.d.ts.map +1 -1
  16. package/dist/components/core/chatter/SolidChatterMessageBox.js +29 -5
  17. package/dist/components/core/chatter/SolidChatterMessageBox.js.map +1 -1
  18. package/dist/components/core/chatter/SolidChatterMessageBox.tsx +57 -4
  19. package/dist/components/core/chatter/SolidMessageComposer.d.ts.map +1 -1
  20. package/dist/components/core/chatter/SolidMessageComposer.js +33 -7
  21. package/dist/components/core/chatter/SolidMessageComposer.js.map +1 -1
  22. package/dist/components/core/chatter/SolidMessageComposer.tsx +61 -7
  23. package/dist/components/core/chatter/chatter.module.css +63 -0
  24. package/dist/components/core/chatter/chatterMentions.d.ts +17 -0
  25. package/dist/components/core/chatter/chatterMentions.d.ts.map +1 -0
  26. package/dist/components/core/chatter/chatterMentions.js +50 -0
  27. package/dist/components/core/chatter/chatterMentions.js.map +1 -0
  28. package/dist/components/core/chatter/chatterMentions.ts +59 -0
  29. package/dist/components/core/chatter/useChatterMentions.d.ts +26 -0
  30. package/dist/components/core/chatter/useChatterMentions.d.ts.map +1 -0
  31. package/dist/components/core/chatter/useChatterMentions.js +204 -0
  32. package/dist/components/core/chatter/useChatterMentions.js.map +1 -0
  33. package/dist/components/core/chatter/useChatterMentions.ts +160 -0
  34. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  35. package/dist/components/core/form/fields/SolidMediaMultipleField.js +111 -106
  36. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  37. package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +165 -134
  38. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  39. package/dist/components/core/form/fields/SolidMediaSingleField.js +81 -84
  40. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  41. package/dist/components/core/form/fields/SolidMediaSingleField.tsx +97 -86
  42. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +1 -1
  43. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  44. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +4 -0
  45. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  46. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +6 -0
  47. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  48. package/dist/components/core/list/SolidListView.js +4 -3
  49. package/dist/components/core/list/SolidListView.js.map +1 -1
  50. package/dist/components/core/list/SolidListView.tsx +4 -3
  51. package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
  52. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +42 -81
  53. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
  54. package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +90 -120
  55. package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
  56. package/dist/components/core/list/columns/SolidMediaSingleColumn.js +34 -42
  57. package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
  58. package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +51 -46
  59. package/dist/components/core/model/CreateModel.d.ts.map +1 -1
  60. package/dist/components/core/model/CreateModel.js +3 -2
  61. package/dist/components/core/model/CreateModel.js.map +1 -1
  62. package/dist/components/core/model/CreateModel.tsx +4 -1
  63. package/dist/components/core/model/FieldMetaData.d.ts +1 -1
  64. package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
  65. package/dist/components/core/model/FieldMetaData.js +17 -17
  66. package/dist/components/core/model/FieldMetaData.js.map +1 -1
  67. package/dist/components/core/model/FieldMetaData.tsx +10 -2
  68. package/dist/components/shad-cn-ui/SolidTextarea.d.ts +1 -1
  69. package/dist/components/shad-cn-ui/SolidTextarea.d.ts.map +1 -1
  70. package/dist/components/shad-cn-ui/SolidTextarea.js +4 -3
  71. package/dist/components/shad-cn-ui/SolidTextarea.js.map +1 -1
  72. package/dist/components/shad-cn-ui/SolidTextarea.tsx +4 -2
  73. package/dist/helpers/downloadMediaFile.d.ts.map +1 -1
  74. package/dist/helpers/downloadMediaFile.js +10 -3
  75. package/dist/helpers/downloadMediaFile.js.map +1 -1
  76. package/dist/helpers/downloadMediaFile.tsx +13 -7
  77. package/dist/helpers/fileTypeIcon.d.ts +3 -2
  78. package/dist/helpers/fileTypeIcon.d.ts.map +1 -1
  79. package/dist/helpers/fileTypeIcon.js +11 -7
  80. package/dist/helpers/fileTypeIcon.js.map +1 -1
  81. package/dist/helpers/fileTypeIcon.tsx +12 -7
  82. package/dist/helpers/mediaType.d.ts +7 -0
  83. package/dist/helpers/mediaType.d.ts.map +1 -1
  84. package/dist/helpers/mediaType.js +39 -8
  85. package/dist/helpers/mediaType.js.map +1 -1
  86. package/dist/helpers/mediaType.ts +46 -7
  87. package/dist/helpers/mediaUrl.d.ts +2 -0
  88. package/dist/helpers/mediaUrl.d.ts.map +1 -0
  89. package/dist/helpers/mediaUrl.js +10 -0
  90. package/dist/helpers/mediaUrl.js.map +1 -0
  91. package/dist/helpers/mediaUrl.ts +11 -0
  92. package/dist/resources/globals.css +14 -0
  93. package/dist/resources/solid-tailwind-generated.css +1 -1
  94. package/package.json +1 -1
@@ -22,12 +22,15 @@ import { FileReaderExt } from "../../../../components/common/FileReaderExt";
22
22
  import getAcceptedFileTypes from "../../../../helpers/getAcceptedFileTypes";
23
23
  import { downloadMediaFile } from "../../../../helpers/downloadMediaFile";
24
24
  import { getExtensionComponent } from "../../../../helpers/registry";
25
+ import { openMediaInNewTab } from "../../../../helpers/mediaUrl";
26
+ import { getMediaPreviewKind, isLightboxMediaKind } from "../../../../helpers/mediaType";
25
27
  import { SolidFormFieldWidgetProps, SolidMediaFormFieldWidgetProps } from "../../../../types/solid-core";
26
28
  import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
27
29
  import { ERROR_MESSAGES } from "../../../../constants/error-messages";
28
30
  import styles from "./solidFields.module.css";
29
31
  import { SolidIcon } from "../../../shad-cn-ui";
30
32
  import { buildMediaFieldKey, getPersistedMediaId } from "./mediaFieldUtils";
33
+
31
34
  export class SolidMediaMultipleField implements ISolidField {
32
35
 
33
36
  private fieldContext: SolidFieldProps;
@@ -190,41 +193,47 @@ export const DefaultMediaMultipleFormEditWidget = ({ formik, fieldContext, setLi
190
193
  const [deleteMedia] = useDeleteMediaMutation();
191
194
  useEffect(() => {
192
195
  const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
193
- const objectUrls: string[] = [];
196
+ if (!Array.isArray(fieldValue) || fieldValue.length === 0) {
197
+ setFileDetails([]);
198
+ return;
199
+ }
194
200
 
195
- if (Array.isArray(fieldValue) && fieldValue.length > 0) {
196
- const details: MediaFileDetail[] = [];
197
- fieldValue.forEach((file: File | any) => {
201
+ const objectUrls: string[] = [];
202
+ const details = fieldValue
203
+ .map((file: File | any): MediaFileDetail | null => {
198
204
  if (file instanceof File) {
199
205
  const fileUrl = URL.createObjectURL(file);
200
206
  objectUrls.push(fileUrl);
201
-
202
- details.push({
207
+ return {
203
208
  name: file.name,
204
209
  type: file.type,
205
210
  size: file.size,
206
211
  mediaId: null,
207
212
  fileKey: buildMediaFieldKey(file),
208
- fileUrl: fileUrl
209
- });
210
- } else if (typeof file === "object" && file._full_url) {
211
- details.push({
212
- name: file.originalFileName,
213
- type: file.mimeType,
214
- size: file.fileSize,
215
- mediaId: getPersistedMediaId(file),
216
- fileKey: buildMediaFieldKey(file),
217
- fileUrl: file._full_url
218
- });
213
+ fileUrl,
214
+ };
219
215
  }
220
- });
221
- setFileDetails(details);
222
- } else {
223
- setFileDetails([]);
224
- }
216
+
217
+ const fileUrl = file?._full_url;
218
+ if (!fileUrl) {
219
+ return null;
220
+ }
221
+
222
+ return {
223
+ name: file.originalFileName,
224
+ type: file.mimeType,
225
+ size: file.fileSize,
226
+ mediaId: getPersistedMediaId(file),
227
+ fileKey: buildMediaFieldKey(file),
228
+ fileUrl,
229
+ };
230
+ })
231
+ .filter((detail): detail is MediaFileDetail => detail !== null);
232
+
233
+ setFileDetails(details);
225
234
 
226
235
  return () => {
227
- objectUrls.forEach((url) => URL.revokeObjectURL(url));
236
+ objectUrls.forEach((fileUrl) => URL.revokeObjectURL(fileUrl));
228
237
  };
229
238
  }, [formik.values, fieldLayoutInfo.attrs.name]);
230
239
 
@@ -332,32 +341,25 @@ export const DefaultMediaMultipleFormEditWidget = ({ formik, fieldContext, setLi
332
341
  }
333
342
 
334
343
  const handleFileView = (url: any) => {
335
- const downloadOnlyExt = [
336
- "txt", "zip", "rar",
337
- "doc", "docx",
338
- "xls", "xlsx",
339
- "ppt", "pptx"
340
- ];
341
-
342
- const fileUrl = url?.fileUrl || "";
343
- const cleanUrl = fileUrl.split("?")[0];
344
- const ext = cleanUrl.split(".").pop()?.toLowerCase();
345
-
346
- if (ext && downloadOnlyExt.includes(ext)) {
347
- const link = document.createElement('a');
348
- link.href = url.fileUrl;
349
- link.download = ''; // or specify a file name like 'file.pdf'
350
- link.target = '_blank';
351
- document.body.appendChild(link);
352
- link.click();
353
- document.body.removeChild(link);
344
+ const previewKind = getMediaPreviewKind({
345
+ url: url?.fileUrl,
346
+ fileName: url?.name,
347
+ mimeType: url?.type,
348
+ });
354
349
 
355
- } else {
350
+ if (isLightboxMediaKind(previewKind)) {
356
351
  setLightboxUrls?.([
357
- { src: url.fileUrl, downloadUrl: url.fileUrl },
352
+ {
353
+ src: url.fileUrl,
354
+ downloadUrl: url.fileUrl,
355
+ type: previewKind === "video" ? "video" : undefined
356
+ },
358
357
  ]);
359
358
  setOpenLightbox?.(true);
359
+ return;
360
360
  }
361
+
362
+ openMediaInNewTab(url?.fileUrl);
361
363
  }
362
364
 
363
365
 
@@ -394,34 +396,45 @@ export const DefaultMediaMultipleFormEditWidget = ({ formik, fieldContext, setLi
394
396
  }
395
397
  </div>
396
398
  {fileDetails.length > 0 &&
397
- <div className="solid-file-upload-wrapper">
398
- <div className="flex items-center md:gap-2">
399
+ <div className={`${styles.mediaAttachmentCard} mt-4`}>
400
+ <div className={`${styles.mediaAttachmentRow} flex items-center md:gap-2`}>
399
401
  <FileReaderExt fileDetails={fileDetails[0]} />
400
- <div className="w-full flex flex-col gap-1">
401
- <div className="flex items-center justify-between">
402
- <p className="m-0 w-9 font-normal text-[var(--primary-color)] solid-img-text-wrapper" style={{ cursor: 'pointer' }} onClick={() => handleFileView(fileDetails[0])}>{fileDetails[0].name}</p>
403
- <div className="flex items-center gap-2">
402
+ <div className={`${styles.mediaAttachmentMeta} w-full`}>
403
+ <div className="flex items-start justify-between gap-4">
404
+ <button
405
+ type="button"
406
+ className={styles.mediaAttachmentName}
407
+ onClick={() => handleFileView(fileDetails[0])}
408
+ title={fileDetails[0].name}
409
+ >
410
+ {fileDetails[0].name}
411
+ </button>
412
+ <div className={`${styles.mediaAttachmentActions} flex items-center gap-2`}>
404
413
  <button
405
414
  type="button"
406
415
  className="solid-file-icon-btn"
407
416
  disabled={isFieldDisabled || isFieldReadonly}
408
417
  aria-label="Download file"
409
- onClick={() => downloadMediaFile(fileDetails[0]?.fileUrl, fileDetails[0]?.name)}
418
+ onClick={(event) => {
419
+ event.preventDefault();
420
+ event.stopPropagation();
421
+ downloadMediaFile(fileDetails[0]?.fileUrl, fileDetails[0]?.name);
422
+ }}
410
423
  >
411
424
  <SolidIcon name="si-download" aria-hidden />
412
425
  </button>
413
- <button
414
- type="button"
415
- className="solid-file-icon-btn is-danger"
416
- disabled={isFieldDisabled || isFieldReadonly}
417
- aria-label="Remove file"
418
- onClick={() => confirmDeleteFile(fileDetails[0].fileKey)}
419
- >
420
- <SolidIcon name="si-times" aria-hidden />
421
- </button>
422
- </div>
426
+ <button
427
+ type="button"
428
+ className="solid-file-icon-btn is-danger"
429
+ disabled={isFieldDisabled || isFieldReadonly}
430
+ aria-label="Remove file"
431
+ onClick={() => confirmDeleteFile(fileDetails[0].fileKey)}
432
+ >
433
+ <SolidIcon name="si-times" aria-hidden />
434
+ </button>
423
435
  </div>
424
- <div className="flex items-center gap-2 text-sm">
436
+ </div>
437
+ <div className={styles.mediaAttachmentSize}>
425
438
  {formatFileSize(fileDetails[0].size)}
426
439
  </div>
427
440
  </div>
@@ -456,35 +469,48 @@ export const DefaultMediaMultipleFormEditWidget = ({ formik, fieldContext, setLi
456
469
  fileDetails.map((file, index) => {
457
470
  const fileId = file.fileKey;
458
471
  return (
459
- <div key={fileId} className="solid-file-upload-wrapper">
460
- <div className="flex items-center md:gap-2">
461
- <FileReaderExt fileDetails={file} />
462
- <div className="w-full flex flex-col gap-1">
463
- <div className="flex items-center justify-between">
464
- <p className="m-0 w-11 font-normal text-[var(--primary-color)] solid-img-text-wrapper" style={{ cursor: 'pointer' }} onClick={() => handleFileView(file)}>{file.name}</p>
465
- <div className="flex items-center gap-2">
466
- <button
467
- type="button"
468
- className="solid-file-icon-btn"
469
- disabled={isFieldDisabled || isFieldReadonly}
470
- aria-label="Download file"
471
- onClick={() => downloadMediaFile(file?.fileUrl, file?.name)}
472
- >
473
- <SolidIcon name="si-download" aria-hidden />
474
- </button>
472
+ <div key={fileId} className={index === fileDetails.length - 1 ? "" : "mb-3"}>
473
+ <div className={styles.mediaAttachmentCard}>
474
+ <div className={`${styles.mediaAttachmentRow} flex items-center md:gap-2`}>
475
+ <FileReaderExt fileDetails={file} />
476
+ <div className={`${styles.mediaAttachmentMeta} w-full`}>
477
+ <div className="flex items-start justify-between gap-4">
475
478
  <button
476
479
  type="button"
477
- className="solid-file-icon-btn is-danger"
478
- disabled={isFieldDisabled || isFieldReadonly}
479
- aria-label="Remove file"
480
- onClick={() => confirmDeleteFile(fileId)}
480
+ className={styles.mediaAttachmentName}
481
+ onClick={() => handleFileView(file)}
482
+ title={file.name}
481
483
  >
482
- <SolidIcon name="si-times" aria-hidden />
484
+ {file.name}
483
485
  </button>
486
+ <div className={`${styles.mediaAttachmentActions} flex items-center gap-2`}>
487
+ <button
488
+ type="button"
489
+ className="solid-file-icon-btn"
490
+ disabled={isFieldDisabled || isFieldReadonly}
491
+ aria-label="Download file"
492
+ onClick={(event) => {
493
+ event.preventDefault();
494
+ event.stopPropagation();
495
+ downloadMediaFile(file?.fileUrl, file?.name);
496
+ }}
497
+ >
498
+ <SolidIcon name="si-download" aria-hidden />
499
+ </button>
500
+ <button
501
+ type="button"
502
+ className="solid-file-icon-btn is-danger"
503
+ disabled={isFieldDisabled || isFieldReadonly}
504
+ aria-label="Remove file"
505
+ onClick={() => confirmDeleteFile(fileId)}
506
+ >
507
+ <SolidIcon name="si-times" aria-hidden />
508
+ </button>
509
+ </div>
510
+ </div>
511
+ <div className={styles.mediaAttachmentSize}>
512
+ {formatFileSize(file.size)}
484
513
  </div>
485
- </div>
486
- <div className="flex items-center gap-2 text-sm">
487
- {formatFileSize(file.size)}
488
514
  </div>
489
515
  </div>
490
516
  </div>
@@ -521,7 +547,7 @@ export const DefaultMediaMultipleFormEditWidget = ({ formik, fieldContext, setLi
521
547
  }
522
548
 
523
549
  export const DefaultMediaMultipleFormViewWidget = ({ formik, fieldContext, setLightboxUrls, setOpenLightbox }: SolidMediaFormFieldWidgetProps) => {
524
- const [fileDetails, setFileDetails] = useState<{ name: string; type: string; size: number, id: number, fileUrl: string }[]>([]);
550
+ const [fileDetails, setFileDetails] = useState<{ name: string; type: string; size: number; id: number | string; fileUrl: string }[]>([]);
525
551
  const [isShowAllFiles, setShowAllFiles] = useState(false);
526
552
  const fieldMetadata = fieldContext.fieldMetadata;
527
553
  const fieldLayoutInfo = fieldContext.field;
@@ -539,70 +565,71 @@ export const DefaultMediaMultipleFormViewWidget = ({ formik, fieldContext, setLi
539
565
 
540
566
  useEffect(() => {
541
567
  const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
568
+ if (!Array.isArray(fieldValue) || fieldValue.length === 0) {
569
+ setFileDetails([]);
570
+ return;
571
+ }
542
572
 
543
- if (Array.isArray(fieldValue) && fieldValue.length > 0) {
544
- const urls: string[] = [];
545
- const details: { name: string; type: string; size: number, id: any, fileUrl: string }[] = [];
546
- const objectUrls: string[] = [];
547
- fieldValue.forEach((file: File | any) => {
573
+ const objectUrls: string[] = [];
574
+ const details = fieldValue
575
+ .map((file: File | any) => {
548
576
  if (file instanceof File) {
549
- // New file (from local upload)
550
577
  const fileUrl = URL.createObjectURL(file);
551
- objectUrls.push(fileUrl); // Store URL for cleanup
552
- urls.push(fileUrl);
553
-
554
- details.push({
578
+ objectUrls.push(fileUrl);
579
+ return {
555
580
  name: file.name,
556
581
  type: file.type,
557
582
  size: file.size,
558
583
  id: `${file.name}-${file.size}`,
559
- fileUrl: fileUrl // ✅ Store the generated object URL
560
- });
561
- } else if (typeof file === "object" && file._full_url) {
562
- urls.push(file._full_url);
563
- details.push({
564
- name: file.originalFileName,
565
- type: file.mimeType,
566
- size: file.fileSize,
567
- id: file.id,
568
- fileUrl: file._full_url
569
- });
584
+ fileUrl,
585
+ };
570
586
  }
571
- });
572
- setFileDetails(details);
573
- }
587
+
588
+ const fileUrl = file?._full_url;
589
+ if (!fileUrl) {
590
+ return null;
591
+ }
592
+
593
+ return {
594
+ name: file.originalFileName,
595
+ type: file.mimeType,
596
+ size: file.fileSize,
597
+ id: file.id,
598
+ fileUrl,
599
+ };
600
+ })
601
+ .filter(Boolean) as { name: string; type: string; size: number; id: number | string; fileUrl: string }[];
602
+
603
+ setFileDetails(details);
604
+
605
+ return () => {
606
+ objectUrls.forEach((fileUrl) => URL.revokeObjectURL(fileUrl));
607
+ };
574
608
  }, [formik.values, fieldLayoutInfo.attrs.name]);
575
609
 
576
610
  const handleFileView = (url: any) => {
577
- const downloadOnlyExt = [
578
- "txt", "zip", "rar",
579
- "doc", "docx",
580
- "xls", "xlsx",
581
- "ppt", "pptx"
582
- ];
583
-
584
- const fileUrl = url?.fileUrl || "";
585
- const cleanUrl = fileUrl.split("?")[0];
586
- const ext = cleanUrl.split(".").pop()?.toLowerCase();
587
-
588
- if (ext && downloadOnlyExt.includes(ext)) {
589
- const link = document.createElement('a');
590
- link.href = url.fileUrl;
591
- link.download = ''; // or specify a file name like 'file.pdf'
592
- link.target = '_blank';
593
- document.body.appendChild(link);
594
- link.click();
595
- document.body.removeChild(link);
611
+ const previewKind = getMediaPreviewKind({
612
+ url: url?.fileUrl,
613
+ fileName: url?.name,
614
+ mimeType: url?.type,
615
+ });
596
616
 
597
- } else {
617
+ if (isLightboxMediaKind(previewKind)) {
598
618
  setLightboxUrls?.([
599
- { src: url.fileUrl, downloadUrl: url.fileUrl },
619
+ {
620
+ src: url.fileUrl,
621
+ downloadUrl: url.fileUrl,
622
+ type: previewKind === "video" ? "video" : undefined
623
+ },
600
624
  ]);
601
625
  setOpenLightbox?.(true);
626
+ return;
602
627
  }
628
+
629
+ openMediaInNewTab(url?.fileUrl);
603
630
  }
604
631
 
605
- const renderMediaFileCard = (file: { name: string; type: string; size: number; id: number; fileUrl: string }, className = "") => (
632
+ const renderMediaFileCard = (file: { name: string; type: string; size: number; id: number | string; fileUrl: string }, className = "") => (
606
633
  <div className={`${styles.mediaAttachmentCard} ${className}`.trim()}>
607
634
  <div className={`${styles.mediaAttachmentRow} flex items-center md:gap-2`}>
608
635
  <FileReaderExt fileDetails={file} />
@@ -621,7 +648,11 @@ export const DefaultMediaMultipleFormViewWidget = ({ formik, fieldContext, setLi
621
648
  type="button"
622
649
  className="solid-file-icon-btn"
623
650
  aria-label="Download file"
624
- onClick={() => downloadMediaFile(file?.fileUrl, file?.name)}
651
+ onClick={(event) => {
652
+ event.preventDefault();
653
+ event.stopPropagation();
654
+ downloadMediaFile(file?.fileUrl, file?.name);
655
+ }}
625
656
  >
626
657
  <SolidIcon name="si-download" aria-hidden />
627
658
  </button>
@@ -1 +1 @@
1
- {"version":3,"file":"SolidMediaSingleField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidMediaSingleField.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAK3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAO9E,qBAAa,qBAAsB,YAAW,WAAW;IAErD,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,eAAe,CAAC,CAAyD;IACjF,OAAO,CAAC,eAAe,CAAC,CAA0B;gBACtC,YAAY,EAAE,eAAe,EAAE,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,KAAK,IAAI,EAC/G,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;IAM7C,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAOnD,YAAY,IAAI,GAAG;IAKnB,gBAAgB,IAAI,GAAG,CAAC,MAAM;IAyC9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAoC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAcjE;AAMD,eAAO,MAAM,gCAAgC,+DAAgE,8BAA8B,4CA4U1I,CAAA;AAED,eAAO,MAAM,gCAAgC,+DAAgE,8BAA8B,4CAqH1I,CAAA"}
1
+ {"version":3,"file":"SolidMediaSingleField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidMediaSingleField.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAO3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAc9E,qBAAa,qBAAsB,YAAW,WAAW;IAErD,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,eAAe,CAAC,CAAyD;IACjF,OAAO,CAAC,eAAe,CAAC,CAA0B;gBACtC,YAAY,EAAE,eAAe,EAAE,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,KAAK,IAAI,EAC/G,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;IAM7C,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAOnD,YAAY,IAAI,GAAG;IAKnB,gBAAgB,IAAI,GAAG,CAAC,MAAM;IAyC9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAoC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAcjE;AAMD,eAAO,MAAM,gCAAgC,+DAAgE,8BAA8B,4CA6U1I,CAAA;AAED,eAAO,MAAM,gCAAgC,+DAAgE,8BAA8B,4CAsH1I,CAAA"}