@layers-app/shared 0.4.4 → 0.4.6

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 (256) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  2. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  3. package/dist/components/AppContainer/AppContainer.js +72 -79
  4. package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
  5. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  6. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
  7. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  8. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
  9. package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/Header.js +6 -5
  11. package/dist/components/AppContainer/components/Main.js +4 -4
  12. package/dist/components/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
  13. package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
  14. package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
  15. package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
  16. package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
  17. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  18. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
  19. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  20. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  21. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  22. package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
  23. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  24. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
  25. package/dist/components/AppContainer/types.d.ts +1 -0
  26. package/dist/components/AppContainer/types.d.ts.map +1 -1
  27. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  28. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  29. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -33
  30. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  31. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
  32. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
  33. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +54 -36
  34. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  35. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +2 -0
  36. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  37. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +84 -37
  38. package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
  39. package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
  40. package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
  41. package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
  42. package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
  43. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  44. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
  45. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
  46. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  47. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +138 -84
  48. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
  49. package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
  50. package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
  51. package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
  52. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
  53. package/dist/components/Chat/CallMessage/CallMessage.module.css.js +15 -0
  54. package/dist/components/Chat/CallMessage/index.d.ts +21 -0
  55. package/dist/components/Chat/CallMessage/index.d.ts.map +1 -0
  56. package/dist/components/Chat/CallMessage/index.js +49 -0
  57. package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +9 -0
  58. package/dist/components/Chat/ChatBubble/index.d.ts +14 -0
  59. package/dist/components/Chat/ChatBubble/index.d.ts.map +1 -0
  60. package/dist/components/Chat/ChatBubble/index.js +32 -0
  61. package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +17 -0
  62. package/dist/components/Chat/ChatHeader/index.d.ts +42 -0
  63. package/dist/components/Chat/ChatHeader/index.d.ts.map +1 -0
  64. package/dist/components/Chat/ChatHeader/index.js +78 -0
  65. package/dist/components/Chat/ChatInput/ChatInput.module.css.js +49 -0
  66. package/dist/components/Chat/ChatInput/index.d.ts +74 -0
  67. package/dist/components/Chat/ChatInput/index.d.ts.map +1 -0
  68. package/dist/components/Chat/ChatInput/index.js +288 -0
  69. package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
  70. package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
  71. package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
  72. package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +15 -0
  73. package/dist/components/Chat/ChatLayout/index.d.ts +17 -0
  74. package/dist/components/Chat/ChatLayout/index.d.ts.map +1 -0
  75. package/dist/components/Chat/ChatLayout/index.js +43 -0
  76. package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +21 -0
  77. package/dist/components/Chat/ChatMessage/index.d.ts +47 -0
  78. package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -0
  79. package/dist/components/Chat/ChatMessage/index.js +206 -0
  80. package/dist/components/Chat/ChatPill/ChatPill.module.css.js +11 -0
  81. package/dist/components/Chat/ChatPill/index.d.ts +12 -0
  82. package/dist/components/Chat/ChatPill/index.d.ts.map +1 -0
  83. package/dist/components/Chat/ChatPill/index.js +21 -0
  84. package/dist/components/Chat/DayMeta/index.d.ts +11 -0
  85. package/dist/components/Chat/DayMeta/index.d.ts.map +1 -0
  86. package/dist/components/Chat/DayMeta/index.js +9 -0
  87. package/dist/components/Chat/DialogItem/DialogItem.module.css.js +17 -0
  88. package/dist/components/Chat/DialogItem/index.d.ts +41 -0
  89. package/dist/components/Chat/DialogItem/index.d.ts.map +1 -0
  90. package/dist/components/Chat/DialogItem/index.js +107 -0
  91. package/dist/components/Chat/DialogList/DialogList.module.css.js +7 -0
  92. package/dist/components/Chat/DialogList/index.d.ts +11 -0
  93. package/dist/components/Chat/DialogList/index.d.ts.map +1 -0
  94. package/dist/components/Chat/DialogList/index.js +19 -0
  95. package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +13 -0
  96. package/dist/components/Chat/MediaDocument/index.d.ts +15 -0
  97. package/dist/components/Chat/MediaDocument/index.d.ts.map +1 -0
  98. package/dist/components/Chat/MediaDocument/index.js +73 -0
  99. package/dist/components/Chat/MessageActions/MessageActions.module.css.js +7 -0
  100. package/dist/components/Chat/MessageActions/index.d.ts +23 -0
  101. package/dist/components/Chat/MessageActions/index.d.ts.map +1 -0
  102. package/dist/components/Chat/MessageActions/index.js +68 -0
  103. package/dist/components/Chat/MessageAuthor/index.d.ts +20 -0
  104. package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -0
  105. package/dist/components/Chat/MessageAuthor/index.js +36 -0
  106. package/dist/components/Chat/MessageForward/MessageForward.module.css.js +7 -0
  107. package/dist/components/Chat/MessageForward/index.d.ts +13 -0
  108. package/dist/components/Chat/MessageForward/index.d.ts.map +1 -0
  109. package/dist/components/Chat/MessageForward/index.js +30 -0
  110. package/dist/components/Chat/MessageList/MessageList.module.css.js +21 -0
  111. package/dist/components/Chat/MessageList/index.d.ts +39 -0
  112. package/dist/components/Chat/MessageList/index.d.ts.map +1 -0
  113. package/dist/components/Chat/MessageList/index.js +159 -0
  114. package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +13 -0
  115. package/dist/components/Chat/MessageMeta/index.d.ts +16 -0
  116. package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -0
  117. package/dist/components/Chat/MessageMeta/index.js +33 -0
  118. package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +15 -0
  119. package/dist/components/Chat/MessageReactions/index.d.ts +32 -0
  120. package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -0
  121. package/dist/components/Chat/MessageReactions/index.js +72 -0
  122. package/dist/components/Chat/MessageReply/MessageReply.module.css.js +15 -0
  123. package/dist/components/Chat/MessageReply/index.d.ts +15 -0
  124. package/dist/components/Chat/MessageReply/index.d.ts.map +1 -0
  125. package/dist/components/Chat/MessageReply/index.js +40 -0
  126. package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +11 -0
  127. package/dist/components/Chat/MessageStatus/index.d.ts +14 -0
  128. package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -0
  129. package/dist/components/Chat/MessageStatus/index.js +68 -0
  130. package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +11 -0
  131. package/dist/components/Chat/ServiceMessage/index.d.ts +13 -0
  132. package/dist/components/Chat/ServiceMessage/index.d.ts.map +1 -0
  133. package/dist/components/Chat/ServiceMessage/index.js +21 -0
  134. package/dist/components/Chat/UnreadSeparator/index.d.ts +11 -0
  135. package/dist/components/Chat/UnreadSeparator/index.d.ts.map +1 -0
  136. package/dist/components/Chat/UnreadSeparator/index.js +13 -0
  137. package/dist/components/Chat/colors.d.ts +7 -0
  138. package/dist/components/Chat/colors.d.ts.map +1 -0
  139. package/dist/components/Chat/colors.js +30 -0
  140. package/dist/components/Chat/icons.d.ts +9 -0
  141. package/dist/components/Chat/icons.d.ts.map +1 -0
  142. package/dist/components/Chat/icons.js +49 -0
  143. package/dist/components/Chat/index.d.ts +24 -0
  144. package/dist/components/Chat/index.d.ts.map +1 -0
  145. package/dist/components/Chat/mock-data.d.ts +32 -0
  146. package/dist/components/Chat/mock-data.d.ts.map +1 -0
  147. package/dist/components/Chat/types.d.ts +159 -0
  148. package/dist/components/Chat/types.d.ts.map +1 -0
  149. package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
  150. package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
  151. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  152. package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
  153. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  154. package/dist/components/ColorPicker/ColorPickerList.js +81 -68
  155. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  156. package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
  157. package/dist/components/ColorPicker/icons.js +5 -5
  158. package/dist/components/ColorPicker/types.d.ts +6 -0
  159. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  160. package/dist/components/ColorPicker/types.js +53 -11
  161. package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
  162. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
  163. package/dist/components/ColorPicker/useRecentColors.js +43 -20
  164. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  165. package/dist/components/CommentComposer/types.js +9 -0
  166. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  167. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  168. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  169. package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
  170. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  171. package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
  172. package/dist/components/EmojiPicker/EmojiPicker.d.ts +23 -1
  173. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  174. package/dist/components/EmojiPicker/EmojiPicker.js +126 -88
  175. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  176. package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
  177. package/dist/components/EmojiPicker/IconsPanel.js +28 -25
  178. package/dist/components/EntityIcon.d.ts +1 -0
  179. package/dist/components/EntityIcon.d.ts.map +1 -1
  180. package/dist/components/EntityIcon.js +90 -33
  181. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  182. package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
  183. package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
  184. package/dist/components/ErrorPage/components/Error403.js +25 -21
  185. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  186. package/dist/components/ErrorPage/index.d.ts +5 -1
  187. package/dist/components/ErrorPage/index.d.ts.map +1 -1
  188. package/dist/components/ErrorPage/index.js +17 -10
  189. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  190. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  191. package/dist/components/FilePicker/FilePicker.js +135 -161
  192. package/dist/components/FilePicker/FilePicker.module.css.js +8 -12
  193. package/dist/components/FilePicker/FilePickerGallery.js +13 -13
  194. package/dist/components/FilePicker/FilePickerGiphy.js +4 -4
  195. package/dist/components/FilePicker/FilePickerGoogleDrive.js +3 -3
  196. package/dist/components/FilePicker/FilePickerUnsplash.js +18 -18
  197. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  198. package/dist/components/FilePicker/FilePickerUpload.js +55 -47
  199. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  200. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  201. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  202. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  203. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  204. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  205. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  206. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  207. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  208. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  209. package/dist/components/Loaders/styles.module.css.js +6 -6
  210. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  211. package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
  212. package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
  213. package/dist/components/NavMenu/NavMenu.d.ts +7 -1
  214. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  215. package/dist/components/NavMenu/NavMenu.js +54 -44
  216. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  217. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  218. package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
  219. package/dist/components/NavMenu/types.d.ts +4 -0
  220. package/dist/components/NavMenu/types.d.ts.map +1 -1
  221. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  222. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  223. package/dist/components/Notification/Notification.module.css.js +1 -1
  224. package/dist/components/PillTabs/PillTabs.d.ts +19 -0
  225. package/dist/components/PillTabs/PillTabs.d.ts.map +1 -0
  226. package/dist/components/PillTabs/PillTabs.js +50 -0
  227. package/dist/components/PillTabs/PillTabs.module.css.js +11 -0
  228. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  229. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  230. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  231. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  232. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
  233. package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
  234. package/dist/components/modals/RemoveConfirmModal.js +1 -1
  235. package/dist/components/table/FrontTable.d.ts.map +1 -1
  236. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  237. package/dist/config/envConfig.d.ts +2 -0
  238. package/dist/config/envConfig.d.ts.map +1 -1
  239. package/dist/config/envConfig.js +41 -37
  240. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  241. package/dist/helpers/showNotifications.d.ts +15 -0
  242. package/dist/helpers/showNotifications.d.ts.map +1 -1
  243. package/dist/helpers/showNotifications.js +114 -72
  244. package/dist/helpers/showNotifications.module.css.js +16 -4
  245. package/dist/hooks/useUiPref.d.ts +2 -0
  246. package/dist/hooks/useUiPref.d.ts.map +1 -0
  247. package/dist/hooks/useUiPref.js +80 -0
  248. package/dist/index.css +1 -1
  249. package/dist/index.d.ts +4 -0
  250. package/dist/index.d.ts.map +1 -1
  251. package/dist/index.js +588 -527
  252. package/dist/lang/locales/ui_en.json.js +5 -5
  253. package/dist/lang/locales/ui_es.json.js +1 -1
  254. package/dist/lang/locales/ui_ru.json.js +1 -1
  255. package/docs/README.md +499 -499
  256. package/package.json +78 -75
@@ -1,40 +1,45 @@
1
- import { STEPS as h } from "./constants.js";
2
- const y = ({
3
- instance: r,
1
+ import { isVideoFile as w } from "../../helpers/fileUtils.js";
2
+ import { STEPS as l } from "./constants.js";
3
+ const T = (i) => {
4
+ const t = (i.contentType || "").toLowerCase(), e = i.originalFileName || "", s = w(i.contentType, e), n = t === "application/pdf" || e.toLowerCase().endsWith(".pdf"), o = t.startsWith("image/") || /\.(jpe?g|png|gif|webp|bmp|svg|avif|heic|heif|tiff?|ico)$/i.test(e), c = t.startsWith("audio/") || /\.(mp3|wav|ogg|flac|m4a|aac|opus|weba)$/i.test(e);
5
+ return { isVideo: s, isPdf: n, isImage: o, isAudio: c, isSupported: o || s || n || c };
6
+ }, y = ({
7
+ instance: i,
4
8
  from: t,
5
9
  to: e,
6
10
  duration: s = 200,
7
11
  animationRef: n
8
12
  }) => {
9
13
  n.current && cancelAnimationFrame(n.current);
10
- const c = performance.now(), a = (p) => {
11
- const i = Math.min((p - c) / s, 1), o = 1 - Math.pow(1 - i, 3), x = t.scale + (e.scale - t.scale) * o, l = t.x + (e.x - t.x) * o, m = t.y + (e.y - t.y) * o;
12
- r.setTransformState(x, l, m), i < 1 && (n.current = requestAnimationFrame(a));
14
+ const o = performance.now(), c = (r) => {
15
+ const p = Math.min((r - o) / s, 1), a = 1 - Math.pow(1 - p, 3), m = t.scale + (e.scale - t.scale) * a, f = t.x + (e.x - t.x) * a, d = t.y + (e.y - t.y) * a;
16
+ i.setTransformState(m, f, d), p < 1 && (n.current = requestAnimationFrame(c));
13
17
  };
14
- n.current = requestAnimationFrame(a);
15
- }, I = ({
16
- dir: r,
18
+ n.current = requestAnimationFrame(c);
19
+ }, A = ({
20
+ dir: i,
17
21
  activeRef: t,
18
22
  animationRef: e
19
23
  }) => {
20
24
  const s = t?.instance;
21
25
  if (!s) return;
22
- const { scale: n, positionX: c, positionY: a } = s.transformState, p = s.wrapperComponent?.getBoundingClientRect(), i = (p?.width ?? 0) / 2, o = (p?.height ?? 0) / 2, x = S(n), l = r === "in" ? x + 1 : x - 1, m = Math.min(Math.max(l, 0), h.length - 1), u = h[m], d = u / n, f = i - (i - c) * d, w = o - (o - a) * d;
26
+ const { scale: n, positionX: o, positionY: c } = s.transformState, r = s.wrapperComponent?.getBoundingClientRect(), p = (r?.width ?? 0) / 2, a = (r?.height ?? 0) / 2, m = S(n), f = i === "in" ? m + 1 : m - 1, d = Math.min(Math.max(f, 0), l.length - 1), g = l[d], u = g / n, h = p - (p - o) * u, x = a - (a - c) * u;
23
27
  y({
24
28
  instance: s,
25
- from: { scale: n, x: c, y: a },
26
- to: { scale: u, x: f, y: w },
29
+ from: { scale: n, x: o, y: c },
30
+ to: { scale: g, x: h, y: x },
27
31
  duration: 200,
28
32
  animationRef: e
29
33
  });
30
- }, S = (r) => {
34
+ }, S = (i) => {
31
35
  let t = 0, e = 1 / 0;
32
- return h.forEach((s, n) => {
33
- const c = Math.abs(s - r);
34
- c < e && (e = c, t = n);
36
+ return l.forEach((s, n) => {
37
+ const o = Math.abs(s - i);
38
+ o < e && (e = o, t = n);
35
39
  }), t;
36
40
  };
37
41
  export {
38
42
  y as animateTransform,
39
- I as zoomStep
43
+ T as getAttachmentFormat,
44
+ A as zoomStep
40
45
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useDownloadFile.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/hooks/useDownloadFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkC,MAAM,OAAO,CAAC;AAQvE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,eAAO,MAAM,eAAe,GAAI,eAAe,aAAa;;;oBAI9C,cAAc;;CA8C3B,CAAC"}
1
+ {"version":3,"file":"useDownloadFile.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/hooks/useDownloadFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkC,MAAM,OAAO,CAAC;AAQvE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,eAAO,MAAM,eAAe,GAAI,eAAe,aAAa;;;oBAI9C,cAAc;;CAgD3B,CAAC"}
@@ -1,35 +1,38 @@
1
- import { useState as w, useCallback as u, useMemo as p } from "react";
2
- import { downloadImageFromExternalUrl as m, downloadURL as c } from "../../../helpers/download.js";
3
- import { isVideoFile as b } from "../../../helpers/fileUtils.js";
4
- import { useMenu as F } from "../../../hooks/useMenu.js";
5
- const L = (o) => {
6
- const [l, e] = w(!1), n = u(
7
- async (a) => {
8
- if (a.stopPropagation(), !!o)
9
- if (e(!0), o?.Url)
10
- await m(o?.Url, "file"), e(!1);
11
- else {
12
- const i = await fetch(`/v1/attachments/${o.id}`, {
13
- method: "GET"
14
- });
15
- if (!i.ok)
16
- throw e(!1), new Error(`Error loading: ${i.statusText}`);
17
- const d = await i.blob();
18
- e(!1);
19
- const s = window.URL.createObjectURL(d);
20
- s && o && (o.id ? c(s, o.originalFileName || "file") : m(s, "file"));
21
- }
1
+ import { useState as u, useCallback as c, useMemo as p } from "react";
2
+ import { downloadImageFromExternalUrl as a, downloadURL as b } from "../../../helpers/download.js";
3
+ import { isVideoFile as F } from "../../../helpers/fileUtils.js";
4
+ import { useMenu as U } from "../../../hooks/useMenu.js";
5
+ const M = (o) => {
6
+ const [l, e] = u(!1), r = c(
7
+ async (d) => {
8
+ if (d.stopPropagation(), !o)
9
+ return;
10
+ e(!0);
11
+ const i = o.originalFileName || "file";
12
+ if (o?.Url)
13
+ await a(o?.Url, i), e(!1);
14
+ else {
15
+ const s = await fetch(`/v1/attachments/${o.id}`, {
16
+ method: "GET"
17
+ });
18
+ if (!s.ok)
19
+ throw e(!1), new Error(`Error loading: ${s.statusText}`);
20
+ const w = await s.blob();
21
+ e(!1);
22
+ const n = window.URL.createObjectURL(w);
23
+ n && o && (o.id ? b(n, i) : a(n, i));
24
+ }
22
25
  },
23
26
  [o]
24
- ), { isMobile: r } = F(), f = b(
27
+ ), { isMobile: f } = U(), m = F(
25
28
  o?.contentType,
26
29
  o?.originalFileName
27
30
  );
28
31
  return p(
29
- () => ({ isVideo: f, isMobile: r, onDownload: n, isFetching: l }),
30
- [r, f, n, l]
32
+ () => ({ isVideo: m, isMobile: f, onDownload: r, isFetching: l }),
33
+ [f, m, r, l]
31
34
  );
32
35
  };
33
36
  export {
34
- L as useDownloadFile
37
+ M as useDownloadFile
35
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useGetPreviewUrl.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAOrD,eAAO,MAAM,gBAAgB,GAAI,YAAY,aAAa;;;;;;;;;;CA4GzD,CAAC"}
1
+ {"version":3,"file":"useGetPreviewUrl.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAQrD,eAAO,MAAM,gBAAgB,GAAI,YAAY,aAAa;;;;;;;;;;CA0FzD,CAAC"}
@@ -1,20 +1,20 @@
1
- import { useState as p, useEffect as F, useMemo as T } from "react";
2
- import { getEnvConfig as L } from "../../../config/envConfig.js";
3
- import { isVideoFile as v } from "../../../helpers/fileUtils.js";
4
- const h = () => {
5
- const e = L().apiBaseUrl || "";
1
+ import { useState as f, useEffect as A, useMemo as v } from "react";
2
+ import { getEnvConfig as F } from "../../../config/envConfig.js";
3
+ import { getAttachmentFormat as $ } from "../helpers.js";
4
+ const m = () => {
5
+ const e = F().apiBaseUrl || "";
6
6
  return e.endsWith("/") ? e.slice(0, -1) : e;
7
- }, B = (e) => {
8
- const [u, y] = p(null), [d, n] = p(!1), [w, a] = p(!1);
9
- async function g(i) {
10
- return fetch(`${h()}/v1/attachments/${i}`, {
7
+ }, S = (e) => {
8
+ const [l, g] = f(null), [u, n] = f(!1), [d, a] = f(!1);
9
+ async function p(r) {
10
+ return fetch(`${m()}/v1/attachments/${r}`, {
11
11
  method: "GET",
12
12
  credentials: "include"
13
13
  });
14
14
  }
15
- async function m() {
15
+ async function U() {
16
16
  try {
17
- return (await fetch(`${h()}/v1/auth/refresh`, {
17
+ return (await fetch(`${m()}/v1/auth/refresh`, {
18
18
  method: "POST",
19
19
  credentials: "include"
20
20
  })).ok;
@@ -22,46 +22,41 @@ const h = () => {
22
22
  return !1;
23
23
  }
24
24
  }
25
- async function U(i, b) {
25
+ async function E(r, b) {
26
26
  n(!0);
27
- let s = await g(i);
28
- if ((s.status === 401 || s.status === 403) && await m() && (s = await g(i)), !s.ok)
29
- throw n(!1), a(!0), new Error(`Error loading: ${s.statusText}`);
30
- const f = await s.blob(), E = b && f.type !== "application/pdf" ? new Blob([f], { type: "application/pdf" }) : f;
31
- y(window.URL.createObjectURL(E)), n(!1), a(!1);
27
+ let t = await p(r);
28
+ if ((t.status === 401 || t.status === 403) && await U() && (t = await p(r)), !t.ok)
29
+ throw n(!1), a(!0), new Error(`Error loading: ${t.statusText}`);
30
+ const c = await t.blob(), y = b && c.type !== "application/pdf" ? new Blob([c], { type: "application/pdf" }) : c;
31
+ g(window.URL.createObjectURL(y)), n(!1), a(!1);
32
32
  }
33
- const t = v(
34
- e.contentType,
35
- e.originalFileName
36
- ), o = (e.contentType || "").toLowerCase() === "application/pdf" || (e.originalFileName || "").toLowerCase().endsWith(".pdf"), c = (e.contentType || "").toLowerCase().startsWith("image/"), l = (e.contentType || "").toLowerCase().startsWith("audio/") || /\.(mp3|wav|ogg|flac|m4a|aac|opus|weba)$/i.test(
37
- e.originalFileName || ""
38
- ), r = c || t || o || l;
39
- return F(() => {
40
- e.id && !t && r && !e.Url && U(e.id, o);
41
- }, [e.Url, e.id, t, o, r]), T(
33
+ const { isVideo: s, isPdf: i, isImage: h, isAudio: w, isSupported: o } = $(e);
34
+ return A(() => {
35
+ e.id && !s && o && !e.Url && E(e.id, i);
36
+ }, [e.Url, e.id, s, i, o]), v(
42
37
  () => ({
43
- fileUrl: u,
44
- isFetching: d,
45
- isError: w,
38
+ fileUrl: l,
39
+ isFetching: u,
40
+ isError: d,
46
41
  setIsError: a,
47
- isVideo: t,
48
- isPdf: o,
49
- isImage: c,
50
- isAudio: l,
51
- isSupported: r
42
+ isVideo: s,
43
+ isPdf: i,
44
+ isImage: h,
45
+ isAudio: w,
46
+ isSupported: o
52
47
  }),
53
48
  [
49
+ l,
50
+ d,
54
51
  u,
52
+ s,
53
+ i,
54
+ h,
55
55
  w,
56
- d,
57
- t,
58
- o,
59
- c,
60
- l,
61
- r
56
+ o
62
57
  ]
63
58
  );
64
59
  };
65
60
  export {
66
- B as useGetPreviewUrl
61
+ S as useGetPreviewUrl
67
62
  };
@@ -1,6 +1,6 @@
1
- const o = "_container_17z0f_1", n = "_root_17z0f_7", t = "_carouselRoot_17z0f_14", e = "_carouselViewport_17z0f_18", a = "_carouselSlide_17z0f_22", _ = "_navButton_17z0f_29", r = "_navButtonPrev_17z0f_42", i = "_navButtonNext_17z0f_46", c = "_headerAction_17z0f_50", d = "_modalContent_17z0f_64", s = "_modalBody_17z0f_69", u = "_videoContainer_17z0f_75", f = "_imageContainer_17z0f_80", l = "_pdfContainer_17z0f_87", m = "_pdfFrame_17z0f_95", z = "_audioContainer_17z0f_102", v = "_audioName_17z0f_117", C = "_audioElement_17z0f_125", B = {
2
- container: o,
3
- root: n,
1
+ const n = "_container_nqf56_1", o = "_root_nqf56_13", t = "_carouselRoot_nqf56_27", e = "_carouselViewport_nqf56_35", a = "_carouselSlide_nqf56_43", _ = "_navButton_nqf56_57", r = "_navButtonPrev_nqf56_83", i = "_navButtonNext_nqf56_91", c = "_headerAction_nqf56_99", d = "_modalContent_nqf56_127", s = "_modalBody_nqf56_137", u = "_videoContainer_nqf56_149", f = "_imageContainer_nqf56_159", l = "_pdfContainer_nqf56_173", m = "_pdfFrame_nqf56_189", q = "_audioContainer_nqf56_203", v = "_audioName_nqf56_233", C = "_audioElement_nqf56_249", B = {
2
+ container: n,
3
+ root: o,
4
4
  carouselRoot: t,
5
5
  carouselViewport: e,
6
6
  carouselSlide: a,
@@ -14,18 +14,18 @@ const o = "_container_17z0f_1", n = "_root_17z0f_7", t = "_carouselRoot_17z0f_14
14
14
  imageContainer: f,
15
15
  pdfContainer: l,
16
16
  pdfFrame: m,
17
- audioContainer: z,
17
+ audioContainer: q,
18
18
  audioName: v,
19
19
  audioElement: C
20
20
  };
21
21
  export {
22
- z as audioContainer,
22
+ q as audioContainer,
23
23
  C as audioElement,
24
24
  v as audioName,
25
25
  t as carouselRoot,
26
26
  a as carouselSlide,
27
27
  e as carouselViewport,
28
- o as container,
28
+ n as container,
29
29
  B as default,
30
30
  c as headerAction,
31
31
  f as imageContainer,
@@ -36,6 +36,6 @@ export {
36
36
  r as navButtonPrev,
37
37
  l as pdfContainer,
38
38
  m as pdfFrame,
39
- n as root,
39
+ o as root,
40
40
  u as videoContainer
41
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentsPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsPreview/AttachmentsPreview.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIhE,UAAU,8BAA8B;IACtC,KAAK,EAAE,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB,GAAI,8CAKhC,8BAA8B,mDAoNhC,CAAC"}
1
+ {"version":3,"file":"AttachmentsPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsPreview/AttachmentsPreview.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAOhE,UAAU,8BAA8B;IACtC,KAAK,EAAE,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB,GAAI,8CAKhC,8BAA8B,mDA4QhC,CAAC"}
@@ -1,22 +1,24 @@
1
- import { jsxs as n, Fragment as C, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as o, Fragment as P, jsx as a } from "react/jsx-runtime";
2
+ import { useState as M } from "react";
2
3
  import { Download01Icon as g } from "@hugeicons/core-free-icons";
3
- import { HugeiconsIcon as x } from "@hugeicons/react";
4
- import { Stack as v, Grid as z, Box as h, Image as F, LoadingOverlay as f, ActionIcon as c, CloseIcon as I, Flex as y, Text as N } from "@mantine/core";
5
- import { useDisclosure as M } from "@mantine/hooks";
6
- import { getFileIcons as P } from "../../helpers/getFileIcons.js";
7
- import { getFileType as A } from "../../helpers/getFileType.js";
8
- import { AttachmentsGalleryModal as B } from "../AttachmentsGalleryModal/AttachmentsGalleryModal.js";
9
- import a from "./AttachmentsPreview.module.css.js";
10
- const U = ({
11
- files: o,
12
- onRemove: i,
4
+ import { HugeiconsIcon as u } from "@hugeicons/react";
5
+ import { Stack as y, Box as m, Image as z, LoadingOverlay as v, ActionIcon as l, Grid as I, CloseIcon as N, Flex as b, Text as C } from "@mantine/core";
6
+ import { useDisclosure as O } from "@mantine/hooks";
7
+ import { formatBytes as S } from "../../helpers/formatBytes.js";
8
+ import { getFileIcons as G } from "../../helpers/getFileIcons.js";
9
+ import { getFileType as L } from "../../helpers/getFileType.js";
10
+ import { AttachmentsGalleryModal as $ } from "../AttachmentsGalleryModal/AttachmentsGalleryModal.js";
11
+ import r from "./AttachmentsPreview.module.css.js";
12
+ const k = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 24 24' fill='none' stroke='%23adb5bd' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='m3 16 5-5 4 4'/%3E%3Cpath d='m14 14 2-2 5 5'/%3E%3Cline x1='3' y1='3' x2='21' y2='21'/%3E%3C/svg%3E", Y = ({
13
+ files: s,
14
+ onRemove: c,
13
15
  mode: t,
14
- parentIsExisting: u
16
+ parentIsExisting: p
15
17
  }) => {
16
- const [T, { open: w, close: b }] = M(!1), s = o.filter((e) => e.isImage), d = o.filter((e) => !e.isImage), D = s.map((e) => ({
18
+ const [E, { open: x, close: T }] = O(!1), [B, D] = M(0), n = s.filter((e) => e.isImage), h = s.filter((e) => !e.isImage), F = n.map((e) => ({
17
19
  id: e.id,
18
20
  Url: e.url,
19
- contentType: "image",
21
+ contentType: e.type || "image/png",
20
22
  fileName: e.name,
21
23
  originalFileName: e.name,
22
24
  fileSize: e.size,
@@ -30,44 +32,98 @@ const U = ({
30
32
  version: 1,
31
33
  deleted: !1,
32
34
  deletedAt: /* @__PURE__ */ new Date()
33
- })), m = s.every((e) => !e.isTemp), k = () => {
34
- m && w();
35
+ })), d = n.every((e) => !e.isTemp), f = (e) => {
36
+ d && (D(e), x());
35
37
  };
36
- return o.length === 0 ? null : /* @__PURE__ */ n(C, { children: [
37
- /* @__PURE__ */ n(v, { gap: "10px", w: "100%", tabIndex: 0, children: [
38
- s.length > 0 && /* @__PURE__ */ r(z, { gap: "xs", children: s.map((e) => {
39
- const l = o.indexOf(e);
40
- return /* @__PURE__ */ r(z.Col, { span: "content", children: /* @__PURE__ */ n(
41
- h,
38
+ return s.length === 0 ? null : /* @__PURE__ */ o(P, { children: [
39
+ /* @__PURE__ */ o(y, { gap: "10px", w: "100%", tabIndex: 0, children: [
40
+ t === "view" && n.length >= 2 && /* @__PURE__ */ a(
41
+ "div",
42
+ {
43
+ className: r.mediaGrid,
44
+ "data-odd": n.length % 2 === 1,
45
+ children: n.map((e, i) => /* @__PURE__ */ o(
46
+ m,
47
+ {
48
+ pos: "relative",
49
+ className: `${r.imagePreviewWrapper} ${r.mediaTile}`,
50
+ children: [
51
+ /* @__PURE__ */ a(
52
+ z,
53
+ {
54
+ src: e.src,
55
+ fallbackSrc: k,
56
+ fit: "cover",
57
+ className: `${r.tileImg} ${r.mediaFadeIn}`,
58
+ style: { cursor: d ? "zoom-in" : "default" },
59
+ onClick: () => f(i)
60
+ }
61
+ ),
62
+ /* @__PURE__ */ a(
63
+ v,
64
+ {
65
+ visible: e.isTemp && p,
66
+ loaderProps: { size: 20 }
67
+ }
68
+ ),
69
+ !e.isTemp && /* @__PURE__ */ a(
70
+ l,
71
+ {
72
+ component: "a",
73
+ size: "22px",
74
+ href: e.url,
75
+ download: e.name,
76
+ rel: "noopener noreferrer",
77
+ variant: "subtle",
78
+ color: "white",
79
+ bg: "var(--mantine-color-dark-filled, #2E2E2E)",
80
+ className: r.downloadButton,
81
+ children: /* @__PURE__ */ a(u, { size: 16, icon: g })
82
+ }
83
+ )
84
+ ]
85
+ },
86
+ e.id
87
+ ))
88
+ }
89
+ ),
90
+ !(t === "view" && n.length >= 2) && n.length > 0 && /* @__PURE__ */ a(I, { gap: "xs", children: n.map((e, i) => {
91
+ const w = s.indexOf(e);
92
+ return /* @__PURE__ */ a(I.Col, { span: "content", children: /* @__PURE__ */ o(
93
+ m,
42
94
  {
43
- w: 56,
44
- h: 56,
45
95
  pos: "relative",
46
- className: a.imagePreviewWrapper,
96
+ className: r.imagePreviewWrapper,
97
+ style: {
98
+ width: "var(--attachment-image-w, 56px)",
99
+ height: "var(--attachment-image-h, 56px)"
100
+ },
47
101
  children: [
48
- /* @__PURE__ */ r(
49
- F,
102
+ /* @__PURE__ */ a(
103
+ z,
50
104
  {
51
105
  src: e.src,
52
- width: 56,
53
- height: 56,
106
+ fallbackSrc: k,
107
+ className: r.mediaFadeIn,
108
+ w: "100%",
109
+ h: "100%",
54
110
  fit: "cover",
55
111
  radius: "sm",
56
112
  style: {
57
- cursor: m ? "zoom-in" : "default"
113
+ cursor: d ? "zoom-in" : "default"
58
114
  },
59
- onClick: () => k()
115
+ onClick: () => f(i)
60
116
  }
61
117
  ),
62
- /* @__PURE__ */ r(
63
- f,
118
+ /* @__PURE__ */ a(
119
+ v,
64
120
  {
65
- visible: e.isTemp && t === "view" && u,
121
+ visible: e.isTemp && t === "view" && p,
66
122
  loaderProps: { size: 20 }
67
123
  }
68
124
  ),
69
- t === "view" && !e.isTemp && /* @__PURE__ */ r(
70
- c,
125
+ t === "view" && !e.isTemp && /* @__PURE__ */ a(
126
+ l,
71
127
  {
72
128
  component: "a",
73
129
  size: "20px",
@@ -79,54 +135,54 @@ const U = ({
79
135
  top: 2,
80
136
  right: 2,
81
137
  bg: "var(--mantine-color-dark-filled, #2E2E2E)",
82
- className: a.downloadButton,
83
- children: /* @__PURE__ */ r(x, { size: 16, icon: g })
138
+ className: r.downloadButton,
139
+ children: /* @__PURE__ */ a(u, { size: 16, icon: g })
84
140
  }
85
141
  ),
86
- t === "draft" && i && /* @__PURE__ */ r(
87
- c,
142
+ t === "draft" && c && /* @__PURE__ */ a(
143
+ l,
88
144
  {
89
145
  size: "20px",
90
146
  radius: "xl",
91
147
  variant: "filled",
92
- onMouseDown: (p) => p.preventDefault(),
148
+ onMouseDown: (A) => A.preventDefault(),
93
149
  pos: "absolute",
94
150
  color: "dark",
95
- onClick: () => i(l),
96
- className: a.deleteButton,
97
- children: /* @__PURE__ */ r(I, { size: "12px" })
151
+ onClick: () => c(w),
152
+ className: r.deleteButton,
153
+ children: /* @__PURE__ */ a(N, { size: "12px" })
98
154
  }
99
155
  )
100
156
  ]
101
157
  }
102
158
  ) }, e.id);
103
159
  }) }),
104
- d.length > 0 && /* @__PURE__ */ r(
105
- h,
160
+ h.length > 0 && /* @__PURE__ */ a(
161
+ m,
106
162
  {
107
163
  w: "100%",
108
- className: a.filePreviewList,
109
- "data-many": d.length >= 4,
110
- children: d.map((e) => {
111
- const l = o.indexOf(e);
112
- return /* @__PURE__ */ n(h, { className: a.filePreviewWrapper, children: [
113
- /* @__PURE__ */ r(
114
- f,
164
+ className: r.filePreviewList,
165
+ "data-many": t === "draft" && h.length >= 4,
166
+ children: h.map((e) => {
167
+ const i = s.indexOf(e);
168
+ return /* @__PURE__ */ o(m, { className: r.filePreviewWrapper, children: [
169
+ /* @__PURE__ */ a(
170
+ v,
115
171
  {
116
- visible: e.isTemp && t === "view" && u,
172
+ visible: e.isTemp && t === "view" && p,
117
173
  loaderProps: { size: 20 }
118
174
  }
119
175
  ),
120
- /* @__PURE__ */ n(
121
- y,
176
+ /* @__PURE__ */ o(
177
+ b,
122
178
  {
123
179
  align: "center",
124
180
  justify: "space-between",
125
181
  wrap: "nowrap",
126
182
  gap: 2,
127
183
  children: [
128
- /* @__PURE__ */ n(
129
- y,
184
+ /* @__PURE__ */ o(
185
+ b,
130
186
  {
131
187
  align: "center",
132
188
  gap: "xs",
@@ -134,19 +190,19 @@ const U = ({
134
190
  flex: 1,
135
191
  miw: 0,
136
192
  children: [
137
- P(
138
- A(e.type, !1, e.name),
193
+ G(
194
+ L(e.type, !1, e.name),
139
195
  !1,
140
196
  36
141
197
  ),
142
- /* @__PURE__ */ n(v, { gap: 0, flex: 1, miw: 0, children: [
143
- /* @__PURE__ */ r(
144
- N,
198
+ /* @__PURE__ */ o(y, { gap: 0, flex: 1, miw: 0, children: [
199
+ /* @__PURE__ */ a(
200
+ C,
145
201
  {
146
202
  size: "sm",
147
203
  truncate: !0,
148
204
  title: e.name,
149
- className: a.fileDownloadName,
205
+ className: r.fileDownloadName,
150
206
  component: "a",
151
207
  href: e.url,
152
208
  download: e.name,
@@ -155,16 +211,13 @@ const U = ({
155
211
  children: e.name
156
212
  }
157
213
  ),
158
- /* @__PURE__ */ n(N, { size: "xs", c: "dimmed", children: [
159
- Math.round(e.size / 1024),
160
- " KB"
161
- ] })
214
+ /* @__PURE__ */ a(C, { size: "xs", className: r.fileSize, children: S(e.size, 1) })
162
215
  ] })
163
216
  ]
164
217
  }
165
218
  ),
166
- t === "view" && !e.isTemp && /* @__PURE__ */ r(
167
- c,
219
+ t === "view" && !e.isTemp && /* @__PURE__ */ a(
220
+ l,
168
221
  {
169
222
  component: "a",
170
223
  href: e.url,
@@ -173,24 +226,24 @@ const U = ({
173
226
  variant: "subtle",
174
227
  color: "gray",
175
228
  size: "sm",
176
- className: a.downloadButton,
177
- children: /* @__PURE__ */ r(x, { size: 16, icon: g })
229
+ className: r.downloadButton,
230
+ children: /* @__PURE__ */ a(u, { size: 16, icon: g })
178
231
  }
179
232
  )
180
233
  ]
181
234
  }
182
235
  ),
183
- t === "draft" && i && /* @__PURE__ */ r(
184
- c,
236
+ t === "draft" && c && /* @__PURE__ */ a(
237
+ l,
185
238
  {
186
239
  size: "xs",
187
240
  radius: "xl",
188
- onMouseDown: (p) => p.preventDefault(),
241
+ onMouseDown: (w) => w.preventDefault(),
189
242
  variant: "filled",
190
243
  color: "dark",
191
- onClick: () => i(l),
192
- className: a.deleteButton,
193
- children: /* @__PURE__ */ r(I, { size: "12px" })
244
+ onClick: () => c(i),
245
+ className: r.deleteButton,
246
+ children: /* @__PURE__ */ a(N, { size: "12px" })
194
247
  }
195
248
  )
196
249
  ] }, e.id);
@@ -198,16 +251,17 @@ const U = ({
198
251
  }
199
252
  )
200
253
  ] }),
201
- m && /* @__PURE__ */ r(
202
- B,
254
+ d && /* @__PURE__ */ a(
255
+ $,
203
256
  {
204
- opened: T,
205
- onOpenChange: (e) => e ? w() : b(),
206
- attachments: D
257
+ opened: E,
258
+ onOpenChange: (e) => e ? x() : T(),
259
+ attachments: F,
260
+ initialIndex: B
207
261
  }
208
262
  )
209
263
  ] });
210
264
  };
211
265
  export {
212
- U as AttachmentsPreview
266
+ Y as AttachmentsPreview
213
267
  };