@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.
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +72 -79
- package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
- package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
- package/dist/components/AppContainer/components/Header.js +6 -5
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -33
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +54 -36
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +2 -0
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +84 -37
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +138 -84
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
- package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
- package/dist/components/Chat/CallMessage/CallMessage.module.css.js +15 -0
- package/dist/components/Chat/CallMessage/index.d.ts +21 -0
- package/dist/components/Chat/CallMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/CallMessage/index.js +49 -0
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +9 -0
- package/dist/components/Chat/ChatBubble/index.d.ts +14 -0
- package/dist/components/Chat/ChatBubble/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatBubble/index.js +32 -0
- package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +17 -0
- package/dist/components/Chat/ChatHeader/index.d.ts +42 -0
- package/dist/components/Chat/ChatHeader/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatHeader/index.js +78 -0
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +49 -0
- package/dist/components/Chat/ChatInput/index.d.ts +74 -0
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/index.js +288 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
- package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +15 -0
- package/dist/components/Chat/ChatLayout/index.d.ts +17 -0
- package/dist/components/Chat/ChatLayout/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatLayout/index.js +43 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +21 -0
- package/dist/components/Chat/ChatMessage/index.d.ts +47 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatMessage/index.js +206 -0
- package/dist/components/Chat/ChatPill/ChatPill.module.css.js +11 -0
- package/dist/components/Chat/ChatPill/index.d.ts +12 -0
- package/dist/components/Chat/ChatPill/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatPill/index.js +21 -0
- package/dist/components/Chat/DayMeta/index.d.ts +11 -0
- package/dist/components/Chat/DayMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/DayMeta/index.js +9 -0
- package/dist/components/Chat/DialogItem/DialogItem.module.css.js +17 -0
- package/dist/components/Chat/DialogItem/index.d.ts +41 -0
- package/dist/components/Chat/DialogItem/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogItem/index.js +107 -0
- package/dist/components/Chat/DialogList/DialogList.module.css.js +7 -0
- package/dist/components/Chat/DialogList/index.d.ts +11 -0
- package/dist/components/Chat/DialogList/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogList/index.js +19 -0
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +13 -0
- package/dist/components/Chat/MediaDocument/index.d.ts +15 -0
- package/dist/components/Chat/MediaDocument/index.d.ts.map +1 -0
- package/dist/components/Chat/MediaDocument/index.js +73 -0
- package/dist/components/Chat/MessageActions/MessageActions.module.css.js +7 -0
- package/dist/components/Chat/MessageActions/index.d.ts +23 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageActions/index.js +68 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts +20 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageAuthor/index.js +36 -0
- package/dist/components/Chat/MessageForward/MessageForward.module.css.js +7 -0
- package/dist/components/Chat/MessageForward/index.d.ts +13 -0
- package/dist/components/Chat/MessageForward/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageForward/index.js +30 -0
- package/dist/components/Chat/MessageList/MessageList.module.css.js +21 -0
- package/dist/components/Chat/MessageList/index.d.ts +39 -0
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageList/index.js +159 -0
- package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +13 -0
- package/dist/components/Chat/MessageMeta/index.d.ts +16 -0
- package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageMeta/index.js +33 -0
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +15 -0
- package/dist/components/Chat/MessageReactions/index.d.ts +32 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReactions/index.js +72 -0
- package/dist/components/Chat/MessageReply/MessageReply.module.css.js +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReply/index.js +40 -0
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +11 -0
- package/dist/components/Chat/MessageStatus/index.d.ts +14 -0
- package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageStatus/index.js +68 -0
- package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +11 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts +13 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ServiceMessage/index.js +21 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts +11 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts.map +1 -0
- package/dist/components/Chat/UnreadSeparator/index.js +13 -0
- package/dist/components/Chat/colors.d.ts +7 -0
- package/dist/components/Chat/colors.d.ts.map +1 -0
- package/dist/components/Chat/colors.js +30 -0
- package/dist/components/Chat/icons.d.ts +9 -0
- package/dist/components/Chat/icons.d.ts.map +1 -0
- package/dist/components/Chat/icons.js +49 -0
- package/dist/components/Chat/index.d.ts +24 -0
- package/dist/components/Chat/index.d.ts.map +1 -0
- package/dist/components/Chat/mock-data.d.ts +32 -0
- package/dist/components/Chat/mock-data.d.ts.map +1 -0
- package/dist/components/Chat/types.d.ts +159 -0
- package/dist/components/Chat/types.d.ts.map +1 -0
- package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +81 -68
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/types.js +9 -0
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +23 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +126 -88
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +28 -25
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +90 -33
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
- package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
- package/dist/components/ErrorPage/components/Error403.js +25 -21
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.d.ts +5 -1
- package/dist/components/ErrorPage/index.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.js +17 -10
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +135 -161
- package/dist/components/FilePicker/FilePicker.module.css.js +8 -12
- package/dist/components/FilePicker/FilePickerGallery.js +13 -13
- package/dist/components/FilePicker/FilePickerGiphy.js +4 -4
- package/dist/components/FilePicker/FilePickerGoogleDrive.js +3 -3
- package/dist/components/FilePicker/FilePickerUnsplash.js +18 -18
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +55 -47
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
- package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
- package/dist/components/NavMenu/NavMenu.d.ts +7 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.js +54 -44
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
- package/dist/components/NavMenu/types.d.ts +4 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- package/dist/components/PillTabs/PillTabs.d.ts +19 -0
- package/dist/components/PillTabs/PillTabs.d.ts.map +1 -0
- package/dist/components/PillTabs/PillTabs.js +50 -0
- package/dist/components/PillTabs/PillTabs.module.css.js +11 -0
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
- package/dist/components/modals/RemoveConfirmModal.js +1 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +41 -37
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.d.ts +15 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +114 -72
- package/dist/helpers/showNotifications.module.css.js +16 -4
- package/dist/hooks/useUiPref.d.ts +2 -0
- package/dist/hooks/useUiPref.d.ts.map +1 -0
- package/dist/hooks/useUiPref.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +588 -527
- package/dist/lang/locales/ui_en.json.js +5 -5
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/docs/README.md +499 -499
- package/package.json +78 -75
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
11
|
-
const
|
|
12
|
-
|
|
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(
|
|
15
|
-
},
|
|
16
|
-
dir:
|
|
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:
|
|
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:
|
|
26
|
-
to: { scale:
|
|
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 = (
|
|
34
|
+
}, S = (i) => {
|
|
31
35
|
let t = 0, e = 1 / 0;
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
|
|
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
|
-
|
|
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;;
|
|
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
|
|
2
|
-
import { downloadImageFromExternalUrl as
|
|
3
|
-
import { isVideoFile as
|
|
4
|
-
import { useMenu as
|
|
5
|
-
const
|
|
6
|
-
const [l, e] =
|
|
7
|
-
async (
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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:
|
|
27
|
+
), { isMobile: f } = U(), m = F(
|
|
25
28
|
o?.contentType,
|
|
26
29
|
o?.originalFileName
|
|
27
30
|
);
|
|
28
31
|
return p(
|
|
29
|
-
() => ({ isVideo:
|
|
30
|
-
[
|
|
32
|
+
() => ({ isVideo: m, isMobile: f, onDownload: r, isFetching: l }),
|
|
33
|
+
[f, m, r, l]
|
|
31
34
|
);
|
|
32
35
|
};
|
|
33
36
|
export {
|
|
34
|
-
|
|
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":"
|
|
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
|
|
2
|
-
import { getEnvConfig as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const e =
|
|
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
|
-
},
|
|
8
|
-
const [
|
|
9
|
-
async function
|
|
10
|
-
return fetch(`${
|
|
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
|
|
15
|
+
async function U() {
|
|
16
16
|
try {
|
|
17
|
-
return (await fetch(`${
|
|
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
|
|
25
|
+
async function E(r, b) {
|
|
26
26
|
n(!0);
|
|
27
|
-
let
|
|
28
|
-
if ((
|
|
29
|
-
throw n(!1), a(!0), new Error(`Error loading: ${
|
|
30
|
-
const
|
|
31
|
-
|
|
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
|
|
34
|
-
|
|
35
|
-
e.
|
|
36
|
-
|
|
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:
|
|
44
|
-
isFetching:
|
|
45
|
-
isError:
|
|
38
|
+
fileUrl: l,
|
|
39
|
+
isFetching: u,
|
|
40
|
+
isError: d,
|
|
46
41
|
setIsError: a,
|
|
47
|
-
isVideo:
|
|
48
|
-
isPdf:
|
|
49
|
-
isImage:
|
|
50
|
-
isAudio:
|
|
51
|
-
isSupported:
|
|
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
|
-
|
|
57
|
-
t,
|
|
58
|
-
o,
|
|
59
|
-
c,
|
|
60
|
-
l,
|
|
61
|
-
r
|
|
56
|
+
o
|
|
62
57
|
]
|
|
63
58
|
);
|
|
64
59
|
};
|
|
65
60
|
export {
|
|
66
|
-
|
|
61
|
+
S as useGetPreviewUrl
|
|
67
62
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
container:
|
|
3
|
-
root:
|
|
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:
|
|
17
|
+
audioContainer: q,
|
|
18
18
|
audioName: v,
|
|
19
19
|
audioElement: C
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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":"
|
|
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
|
|
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
|
|
4
|
-
import { Stack as
|
|
5
|
-
import { useDisclosure as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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:
|
|
16
|
+
parentIsExisting: p
|
|
15
17
|
}) => {
|
|
16
|
-
const [
|
|
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
|
-
})),
|
|
34
|
-
|
|
35
|
+
})), d = n.every((e) => !e.isTemp), f = (e) => {
|
|
36
|
+
d && (D(e), x());
|
|
35
37
|
};
|
|
36
|
-
return
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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:
|
|
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__ */
|
|
49
|
-
|
|
102
|
+
/* @__PURE__ */ a(
|
|
103
|
+
z,
|
|
50
104
|
{
|
|
51
105
|
src: e.src,
|
|
52
|
-
|
|
53
|
-
|
|
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:
|
|
113
|
+
cursor: d ? "zoom-in" : "default"
|
|
58
114
|
},
|
|
59
|
-
onClick: () =>
|
|
115
|
+
onClick: () => f(i)
|
|
60
116
|
}
|
|
61
117
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
118
|
+
/* @__PURE__ */ a(
|
|
119
|
+
v,
|
|
64
120
|
{
|
|
65
|
-
visible: e.isTemp && t === "view" &&
|
|
121
|
+
visible: e.isTemp && t === "view" && p,
|
|
66
122
|
loaderProps: { size: 20 }
|
|
67
123
|
}
|
|
68
124
|
),
|
|
69
|
-
t === "view" && !e.isTemp && /* @__PURE__ */
|
|
70
|
-
|
|
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:
|
|
83
|
-
children: /* @__PURE__ */
|
|
138
|
+
className: r.downloadButton,
|
|
139
|
+
children: /* @__PURE__ */ a(u, { size: 16, icon: g })
|
|
84
140
|
}
|
|
85
141
|
),
|
|
86
|
-
t === "draft" &&
|
|
87
|
-
|
|
142
|
+
t === "draft" && c && /* @__PURE__ */ a(
|
|
143
|
+
l,
|
|
88
144
|
{
|
|
89
145
|
size: "20px",
|
|
90
146
|
radius: "xl",
|
|
91
147
|
variant: "filled",
|
|
92
|
-
onMouseDown: (
|
|
148
|
+
onMouseDown: (A) => A.preventDefault(),
|
|
93
149
|
pos: "absolute",
|
|
94
150
|
color: "dark",
|
|
95
|
-
onClick: () =>
|
|
96
|
-
className:
|
|
97
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
105
|
-
|
|
160
|
+
h.length > 0 && /* @__PURE__ */ a(
|
|
161
|
+
m,
|
|
106
162
|
{
|
|
107
163
|
w: "100%",
|
|
108
|
-
className:
|
|
109
|
-
"data-many":
|
|
110
|
-
children:
|
|
111
|
-
const
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
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" &&
|
|
172
|
+
visible: e.isTemp && t === "view" && p,
|
|
117
173
|
loaderProps: { size: 20 }
|
|
118
174
|
}
|
|
119
175
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
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__ */
|
|
129
|
-
|
|
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
|
-
|
|
138
|
-
|
|
193
|
+
G(
|
|
194
|
+
L(e.type, !1, e.name),
|
|
139
195
|
!1,
|
|
140
196
|
36
|
|
141
197
|
),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
|
|
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:
|
|
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__ */
|
|
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__ */
|
|
167
|
-
|
|
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:
|
|
177
|
-
children: /* @__PURE__ */
|
|
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" &&
|
|
184
|
-
|
|
236
|
+
t === "draft" && c && /* @__PURE__ */ a(
|
|
237
|
+
l,
|
|
185
238
|
{
|
|
186
239
|
size: "xs",
|
|
187
240
|
radius: "xl",
|
|
188
|
-
onMouseDown: (
|
|
241
|
+
onMouseDown: (w) => w.preventDefault(),
|
|
189
242
|
variant: "filled",
|
|
190
243
|
color: "dark",
|
|
191
|
-
onClick: () => i
|
|
192
|
-
className:
|
|
193
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
202
|
-
|
|
254
|
+
d && /* @__PURE__ */ a(
|
|
255
|
+
$,
|
|
203
256
|
{
|
|
204
|
-
opened:
|
|
205
|
-
onOpenChange: (e) => e ?
|
|
206
|
-
attachments:
|
|
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
|
-
|
|
266
|
+
Y as AttachmentsPreview
|
|
213
267
|
};
|